mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-03 20:14:21 -04:00
Add an ability to enable/disable nscd (#3652)
This commit is contained in:
parent
0c40f02584
commit
cd79df07e1
7 changed files with 69 additions and 6 deletions
|
@ -341,7 +341,11 @@ class UptimeKumaServer {
|
|||
* @returns {Promise<void>}
|
||||
*/
|
||||
async start() {
|
||||
this.startServices();
|
||||
let enable = await Settings.get("nscd");
|
||||
|
||||
if (enable || enable === null) {
|
||||
this.startNSCDServices();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -349,14 +353,18 @@ class UptimeKumaServer {
|
|||
* @returns {Promise<void>}
|
||||
*/
|
||||
async stop() {
|
||||
this.stopServices();
|
||||
let enable = await Settings.get("nscd");
|
||||
|
||||
if (enable || enable === null) {
|
||||
this.stopNSCDServices();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Start all system services (e.g. nscd)
|
||||
* For now, only used in Docker
|
||||
*/
|
||||
startServices() {
|
||||
startNSCDServices() {
|
||||
if (process.env.UPTIME_KUMA_IS_CONTAINER) {
|
||||
try {
|
||||
log.info("services", "Starting nscd");
|
||||
|
@ -370,7 +378,7 @@ class UptimeKumaServer {
|
|||
/**
|
||||
* Stop all system services
|
||||
*/
|
||||
stopServices() {
|
||||
stopNSCDServices() {
|
||||
if (process.env.UPTIME_KUMA_IS_CONTAINER) {
|
||||
try {
|
||||
log.info("services", "Stopping nscd");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue