diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2003-02-03 07:56:44 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2003-02-03 07:56:44 +0000 |
commit | dca3a95be2423ea7e4fe79cbc82deb1367822f72 (patch) | |
tree | e5868043364295378486e7febbcf659092dd40de /perl-install/standalone/interactive_http/miniserv.init | |
parent | e734893910ec95175fba3ae10cf8a1671d6345d3 (diff) | |
download | drakx-backup-do-not-use-dca3a95be2423ea7e4fe79cbc82deb1367822f72.tar drakx-backup-do-not-use-dca3a95be2423ea7e4fe79cbc82deb1367822f72.tar.gz drakx-backup-do-not-use-dca3a95be2423ea7e4fe79cbc82deb1367822f72.tar.bz2 drakx-backup-do-not-use-dca3a95be2423ea7e4fe79cbc82deb1367822f72.tar.xz drakx-backup-do-not-use-dca3a95be2423ea7e4fe79cbc82deb1367822f72.zip |
sanitize draxktools server service script:
- no gratuitous shell forking
- now can be debugged through "sh -x"
- use std shell service lib
- make it print [OK] || [FAILLED]
Diffstat (limited to 'perl-install/standalone/interactive_http/miniserv.init')
-rw-r--r-- | perl-install/standalone/interactive_http/miniserv.init | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/perl-install/standalone/interactive_http/miniserv.init b/perl-install/standalone/interactive_http/miniserv.init index e7673083c..c9aaf9aeb 100644 --- a/perl-install/standalone/interactive_http/miniserv.init +++ b/perl-install/standalone/interactive_http/miniserv.init @@ -2,22 +2,38 @@ # chkconfig: 235 99 00 # description: Start or stop the miniserv administration server +# Source function library. +. /etc/rc.d/init.d/functions + +subsys=/var/lock/subsys/drakxtools_http name=drakxtools_http server=/usr/share/libDrakX/$name/miniserv.pl +start () +{ + action "Starting $name: " perl $server /etc/$name/conf + touch $subsys + echo $name +} + +stop () +{ + action "Shutting down $name: " kill `cat /var/run/$name.pid` + rm -f $subsys + echo $name +} + +restart () +{ + stop + start +} + case "$1" in 'start') - echo -n "Starting $name: " - perl $server /etc/$name/conf - touch /var/lock/subsys/drakxtools_http - echo $name - ;; + start;; 'stop') - echo -n "Shutting down $name: " - kill `cat /var/run/$name.pid` - rm -f /var/lock/subsys/drakxtools_http - echo $name - ;; + stop;; 'status') if [ -s /var/run/$name.pid ]; then pid=`cat /var/run/$name.pid` @@ -32,18 +48,11 @@ case "$1" in fi ;; 'restart') - $0 stop - $0 start - ;; + restart;; 'reload') - $0 stop - $0 start - ;; + restart;; 'condrestart') - if [ -f /var/lock/subsys/drakxtools_http ]; then - $0 restart - fi - ;; + [[ -f $subsys ]] && restart;; *) echo "Usage: $0 {start|stop|restart|status|reload|condrestart}" ;; |