[aur-general] Pommed initscript
Hi, I'm the maintainer of pommed in AUR and I would like to adapt the init daemon script to the Archlinux standard, as user royrocks suggested me. I had a look to the wiki but didn't saw any page conscerning the rules and the way to build an init script adapting to Archlinux rules. Of course, I could build one having a look to other daemons and to the /etc/rc.d/functions script, but I would like to know if there's some kind of documentation I haven't found, so I don't forget anything in the script. Regards, jcerdan
I'm the maintainer of pommed in AUR and I would like to adapt the init daemon script to the Archlinux standard, as user royrocks suggested me.
Hi, 2008/5/2 Jordi Cerdan <jcerdan@tecob.com>: this is the rc-script.proto: #!/bin/bash daemon_name=DAEMON_NAME . /etc/rc.d/functions . /etc/conf.d/$daemon_name.conf . /etc/rc.conf get_pid() { pidof $daemon_name } case "$1" in start) stat_busy "Starting $daemon_name daemon" PID=`get_pid` if [ -z "$PID" ]; then [ -f /var/run/$daemon_name.pid ] && rm -f /var/run/$daemon_name.pid # RUN $daemon_name # if [ $? -gt 0 ]; then stat_fail exit 1 else echo `get_pid` > /var/run/$daemon_name.pid add_daemon $daemon_name stat_done fi else stat_fail exit 1 fi ;; stop) stat_busy "Stopping $daemon_name daemon" PID=`get_pid` # KILL [ ! -z "$PID" ] && kill $PID &> /dev/null # if [ $? -gt 0 ]; then stat_fail exit 1 else rm -f /var/run/$daemon_name.pid &> /dev/null rm_daemon $daemon_name stat_done fi ;; restart) $0 stop sleep 3 $0 start ;; *) echo "usage: $0 {start|stop|restart}" esac exit 0 Regards, Andrea -- Andrea `BaSh` Scarpino Arch Linux Trusted User Linux User: #430842
El vie, 02-05-2008 a las 13:48 +0200, BaSh escribió:
I'm the maintainer of pommed in AUR and I would like to adapt the init daemon script to the Archlinux standard, as user royrocks suggested me.
Hi, 2008/5/2 Jordi Cerdan <jcerdan@tecob.com>: this is the rc-script.proto:
#!/bin/bash
daemon_name=DAEMON_NAME
. /etc/rc.d/functions
. /etc/conf.d/$daemon_name.conf
. /etc/rc.conf
get_pid() { pidof $daemon_name }
case "$1" in start) stat_busy "Starting $daemon_name daemon"
PID=`get_pid` if [ -z "$PID" ]; then [ -f /var/run/$daemon_name.pid ] && rm -f /var/run/$daemon_name.pid # RUN $daemon_name # if [ $? -gt 0 ]; then stat_fail exit 1 else echo `get_pid` > /var/run/$daemon_name.pid add_daemon $daemon_name stat_done fi else stat_fail exit 1 fi ;;
stop) stat_busy "Stopping $daemon_name daemon" PID=`get_pid` # KILL [ ! -z "$PID" ] && kill $PID &> /dev/null # if [ $? -gt 0 ]; then stat_fail exit 1 else rm -f /var/run/$daemon_name.pid &> /dev/null rm_daemon $daemon_name stat_done fi ;;
restart) $0 stop sleep 3 $0 start ;; *) echo "usage: $0 {start|stop|restart}" esac exit 0
Regards, Andrea
Thanks Andrea, I looked for .proto right now on wiki and found this. http://wiki.archlinux.org/index.php/Arch_CVS_% 26_SVN_PKGBUILD_guidelines May be this needs a wiki page alone? Regards. jcerdan
participants (2)
-
BaSh
-
Jordi Cerdan