[aur-general] Pommed initscript
Jordi Cerdan
jcerdan at tecob.com
Fri May 2 08:06:34 EDT 2008
El vie, 02-05-2008 a las 13:48 +0200, BaSh escribió:
> Hi,
> 2008/5/2 Jordi Cerdan <jcerdan at tecob.com>:
> > 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.
> 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
More information about the aur-general
mailing list