mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
test-conf -> test_conf, and test-status -> test_status
This commit is contained in:
parent
a9dd701824
commit
5a68250322
2 changed files with 11 additions and 11 deletions
|
@ -1,6 +1,6 @@
|
||||||
nginx:
|
nginx:
|
||||||
log: /var/log/nginx
|
log: /var/log/nginx
|
||||||
test-conf: nginx -t
|
test_conf: nginx -t
|
||||||
needs_exposed_ports: [80, 443]
|
needs_exposed_ports: [80, 443]
|
||||||
avahi-daemon:
|
avahi-daemon:
|
||||||
log: /var/log/daemon.log
|
log: /var/log/daemon.log
|
||||||
|
@ -13,7 +13,7 @@ dovecot:
|
||||||
needs_exposed_ports: [993]
|
needs_exposed_ports: [993]
|
||||||
postfix:
|
postfix:
|
||||||
log: [/var/log/mail.log,/var/log/mail.err]
|
log: [/var/log/mail.log,/var/log/mail.err]
|
||||||
test-status: systemctl show postfix@- | grep -q "^SubState=running"
|
test_status: systemctl show postfix@- | grep -q "^SubState=running"
|
||||||
needs_exposed_ports: [25, 587]
|
needs_exposed_ports: [25, 587]
|
||||||
rspamd:
|
rspamd:
|
||||||
log: /var/log/rspamd/rspamd.log
|
log: /var/log/rspamd/rspamd.log
|
||||||
|
@ -24,7 +24,7 @@ mysql:
|
||||||
alternates: ['mariadb']
|
alternates: ['mariadb']
|
||||||
ssh:
|
ssh:
|
||||||
log: /var/log/auth.log
|
log: /var/log/auth.log
|
||||||
test-conf: sshd -t
|
test_conf: sshd -t
|
||||||
needs_exposed_ports: [22]
|
needs_exposed_ports: [22]
|
||||||
metronome:
|
metronome:
|
||||||
log: [/var/log/metronome/metronome.log,/var/log/metronome/metronome.err]
|
log: [/var/log/metronome/metronome.log,/var/log/metronome/metronome.err]
|
||||||
|
@ -33,12 +33,12 @@ slapd:
|
||||||
log: /var/log/syslog
|
log: /var/log/syslog
|
||||||
php7.0-fpm:
|
php7.0-fpm:
|
||||||
log: /var/log/php7.0-fpm.log
|
log: /var/log/php7.0-fpm.log
|
||||||
test-conf: php-fpm7.0 --test
|
test_conf: php-fpm7.0 --test
|
||||||
yunohost-api:
|
yunohost-api:
|
||||||
log: /var/log/yunohost/yunohost-api.log
|
log: /var/log/yunohost/yunohost-api.log
|
||||||
yunohost-firewall:
|
yunohost-firewall:
|
||||||
need_lock: true
|
need_lock: true
|
||||||
test-status: iptables -S | grep "^-A INPUT" | grep " --dport" | grep -q ACCEPT
|
test_status: iptables -S | grep "^-A INPUT" | grep " --dport" | grep -q ACCEPT
|
||||||
nslcd:
|
nslcd:
|
||||||
log: /var/log/syslog
|
log: /var/log/syslog
|
||||||
glances: null
|
glances: null
|
||||||
|
|
|
@ -327,14 +327,14 @@ def service_status(names=[]):
|
||||||
if "StateChangeTimestamp" in status:
|
if "StateChangeTimestamp" in status:
|
||||||
result[name]['last_state_change'] = datetime.utcfromtimestamp(status["StateChangeTimestamp"] / 1000000)
|
result[name]['last_state_change'] = datetime.utcfromtimestamp(status["StateChangeTimestamp"] / 1000000)
|
||||||
|
|
||||||
# 'test-status' is an optional field to test the status of the service using a custom command
|
# 'test_status' is an optional field to test the status of the service using a custom command
|
||||||
if "test-status" in services[name]:
|
if "test_status" in services[name]:
|
||||||
status = os.system(services[name]["test-status"])
|
status = os.system(services[name]["test_status"])
|
||||||
result[name]["status"] = "running" if status == 0 else "failed"
|
result[name]["status"] = "running" if status == 0 else "failed"
|
||||||
|
|
||||||
# 'test-status' is an optional field to test the status of the service using a custom command
|
# 'test_status' is an optional field to test the status of the service using a custom command
|
||||||
if "test-conf" in services[name]:
|
if "test_conf" in services[name]:
|
||||||
p = subprocess.Popen(services[name]["test-conf"],
|
p = subprocess.Popen(services[name]["test_conf"],
|
||||||
shell=True,
|
shell=True,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.STDOUT)
|
stderr=subprocess.STDOUT)
|
||||||
|
|
Loading…
Add table
Reference in a new issue