mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2025-01-27 23:44:04 +00:00
aur/netatalk to 2.2.2-6
This commit is contained in:
parent
77e0e7481e
commit
ba10a28544
12 changed files with 184 additions and 176 deletions
|
@ -9,7 +9,7 @@ plugrel=1
|
|||
pkgname=netatalk
|
||||
true && pkgname=('netatalk' 'netatalk-ddp')
|
||||
pkgver=2.2.2
|
||||
pkgrel=4
|
||||
pkgrel=6
|
||||
pkgdesc='A kernel-level implementation of AppleTalk, AFP, and PAP services'
|
||||
arch=('i686' 'x86_64')
|
||||
url='http://netatalk.sourceforge.net'
|
||||
|
@ -24,15 +24,15 @@ backup=('etc/netatalk/afpd.conf'
|
|||
options=('!libtool')
|
||||
install=$pkgname.install
|
||||
changelog=$pkgname.changelog
|
||||
source=(a2boot afpd atalkd cnid_metad netatalk papd timelord \
|
||||
source=(a2boot.rc afpd.rc atalkd.rc cnid_metad.rc netatalk.rc papd.rc timelord.rc \
|
||||
http://hivelocity.dl.sourceforge.net/project/$pkgname/$pkgname/$pkgver/$pkgname-$pkgver.tar.bz2)
|
||||
md5sums=('747f0f3870fc0472fff5d502acd83fda'
|
||||
'3b936b466b00a479aadb32df60960538'
|
||||
'14dd9d43125eec9be438e4474b271ff0'
|
||||
'1eb353a1e0581f9d764826a2f2d9b6f2'
|
||||
'c89d35e5ea67edfd08ebfccb306f6c47'
|
||||
'd8fa2b290cac33b4de77a7b69ef03db9'
|
||||
'80299f81b0413329479073fe02e85de5'
|
||||
md5sums=('792435b982af01a206b43f82115d4820'
|
||||
'812f2a6236c495682e768704007b9b7d'
|
||||
'8348b1bd91ff4a9c2d5e2bbb44cbc970'
|
||||
'bc8c1f7e2af6e02982dc375fbf02f4d6'
|
||||
'4226d26b886d6cff422c4a5bd5b88d55'
|
||||
'288ee4394109ad8e163518a3b335064b'
|
||||
'8a60ce9165f1346dab37045ce440c4cd'
|
||||
'bd42b686ec7209d9ab47bd8e2e2431c4')
|
||||
_options='--disable-ddp --disable-srvloc --disable-timelord --disable-cups --disable-a2boot'
|
||||
_depddp=('openslp' 'libcups' 'libgcrypt>=1.2.3')
|
||||
|
@ -40,7 +40,7 @@ _depddp=('openslp' 'libcups' 'libgcrypt>=1.2.3')
|
|||
build() {
|
||||
if [ "$pkgname" = "netatalk-ddp" ];then resolve_deps ${_depddp[@]}
|
||||
_options=`echo $_options | sed s/disable/enable/g`;fi
|
||||
cd "$srcdir"/$pkgbase-$pkgver
|
||||
cd $pkgbase-$pkgver
|
||||
msg2 'Configuring...'
|
||||
CFLAGS="-Wno-unused-result" ./configure --prefix=/usr --localstatedir=/var --libexecdir='${libdir}' \
|
||||
--with-cracklib --with-cnid-cdb-backend --enable-fhs $_options
|
||||
|
@ -49,23 +49,28 @@ build() {
|
|||
echo $pkgname >made
|
||||
}
|
||||
package() {
|
||||
cd "$srcdir"/$pkgbase-$pkgver
|
||||
if [ -f made ];then rm made;else continue;fi
|
||||
cd $pkgbase-$pkgver
|
||||
if [ -f made ];then rm made;else rm -rf "$pkgdir";continue;fi
|
||||
msg2 'Building...'
|
||||
make DESTDIR="$pkgdir" install >/dev/null
|
||||
msg2 'Copying initscripts...'
|
||||
install -d "$pkgdir"/etc/rc.d
|
||||
install -m755 "$srcdir"/{a2boot,atalkd,afpd,cnid_metad,netatalk,papd,timelord} "$pkgdir"/etc/rc.d
|
||||
install -D -m755 "$srcdir"/netatalk.rc "$pkgdir"/etc/rc.d/netatalk
|
||||
install -m755 "$srcdir"/cnid_metad.rc "$pkgdir"/etc/rc.d/cnid_metad
|
||||
install -m755 "$srcdir"/afpd.rc "$pkgdir"/etc/rc.d/afpd
|
||||
msg2 'Removing extraneous files...'
|
||||
rm -r "$pkgdir"/usr/include "$pkgdir"/usr/share/aclocal
|
||||
}
|
||||
package_netatalk() {
|
||||
package
|
||||
rm "$pkgdir"/usr/share/man/man8/timelord.8 "$pkgdir"/etc/rc.d/{a2boot,atalkd,papd,timelord}
|
||||
rm "$pkgdir"/usr/share/man/man8/timelord.8
|
||||
rmdir "$pkgdir"/usr/share/man/man3 "$pkgdir"/usr/share/man/man4
|
||||
}
|
||||
package_netatalk-ddp() {
|
||||
package
|
||||
install -m755 "$srcdir"/a2boot.rc "$pkgdir"/etc/rc.d/a2boot
|
||||
install -m755 "$srcdir"/atalkd.rc "$pkgdir"/etc/rc.d/atalkd
|
||||
install -m755 "$srcdir"/papd.rc "$pkgdir"/etc/rc.d/papd
|
||||
install -m755 "$srcdir"/timelord.rc "$pkgdir"/etc/rc.d/timelord
|
||||
optdepends=('cups: required for PAP support')
|
||||
backup+=('etc/netatalk/atalkd.conf' 'etc/netatalk/papd.conf' 'etc/pam.d/netatalk')
|
||||
conflicts=('netatalk');provides=(${conflicts[@]});depends=(${_depddp[@]})
|
||||
|
|
|
@ -2,44 +2,38 @@
|
|||
|
||||
. /etc/rc.conf
|
||||
. /etc/rc.d/functions
|
||||
. /etc/rc.d/netatalk common
|
||||
|
||||
NAME="Apple II Boot Daemon"
|
||||
ARGS=
|
||||
DEPENDS=atalkd
|
||||
REQUIRED=
|
||||
DAEMON=`basename "$0"`
|
||||
DAEMON=a2boot
|
||||
|
||||
[ -r /etc/conf.d/$DAEMON ] && . /etc/conf.d/$DAEMON
|
||||
|
||||
PID=`get_pid $DAEMON`
|
||||
|
||||
get_pid_r() {
|
||||
local pid=()
|
||||
for i in $@
|
||||
do j=`get_pid $i` || return 1;pid+=($j);done
|
||||
echo ${pid[@]};
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
stat_busy "Starting $NAME"
|
||||
[ `get_pid_r $DEPENDS` ] && [ -z "$PID" ] && $DAEMON $ARGS &>/dev/null
|
||||
`get_pid_rd $DEPENDS` && [ -z "$PID" ] && $DAEMON $ARGS &>/dev/null
|
||||
if [ $? = 0 ]; then
|
||||
stat_done
|
||||
else
|
||||
stat_fail
|
||||
if [ ! `get_pid_r $DEPENDS` ];then echo "Error: \"$DAEMON\" refusing to start, dependency \"$DEPENDS\" not met" >&2;fi
|
||||
if ! `get_pid_rd $DEPENDS`;then echo "Error: \"$DAEMON\" refusing to start, dependency \"$DEPENDS\" not met" >&2;fi
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
stat_busy "Stopping $NAME"
|
||||
[ ! `get_pid_r $REQUIRED` ] && [ -n "$PID" ] && kill $PID &>/dev/null
|
||||
`get_pid_rr $REQUIRED` && [ -n "$PID" ] && kill $PID &>/dev/null
|
||||
if [ $? = 0 ]; then
|
||||
stat_done
|
||||
else
|
||||
stat_fail
|
||||
if [ `get_pid_r $REQUIRED` ];then echo "Error: Dependency \"$REQUIRED\" requires \"$DAEMON\", stop it first" >&2;fi
|
||||
if ! `get_pid_rr $REQUIRED`;then echo "Error: Dependency \"$REQUIRED\" requires \"$DAEMON\", stop it first" >&2;fi
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
@ -50,4 +44,4 @@ case "$1" in
|
|||
;;
|
||||
*)
|
||||
echo "usage: $0 {start|stop|restart}"
|
||||
esac
|
||||
esac
|
|
@ -2,44 +2,38 @@
|
|||
|
||||
. /etc/rc.conf
|
||||
. /etc/rc.d/functions
|
||||
. /etc/rc.d/netatalk common
|
||||
|
||||
NAME="Apple Filing Protocol Daemon"
|
||||
ARGS=
|
||||
DEPENDS=cnid_metad
|
||||
REQUIRED=
|
||||
DAEMON=`basename "$0"`
|
||||
DAEMON=afpd
|
||||
|
||||
[ -r /etc/conf.d/$DAEMON ] && . /etc/conf.d/$DAEMON
|
||||
|
||||
PID=`get_pid $DAEMON`
|
||||
|
||||
get_pid_r() {
|
||||
local pid=()
|
||||
for i in $@
|
||||
do j=`get_pid $i` || return 1;pid+=($j);done
|
||||
echo ${pid[@]};
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
stat_busy "Starting $NAME"
|
||||
[ `get_pid_r $DEPENDS` ] && [ -z "$PID" ] && $DAEMON $ARGS &>/dev/null
|
||||
`get_pid_rd $DEPENDS` && [ -z "$PID" ] && $DAEMON $ARGS &>/dev/null
|
||||
if [ $? = 0 ]; then
|
||||
stat_done
|
||||
else
|
||||
stat_fail
|
||||
if [ ! `get_pid_r $DEPENDS` ];then echo "Error: \"$DAEMON\" refusing to start, dependency \"$DEPENDS\" not met" >&2;fi
|
||||
if ! `get_pid_rd $DEPENDS`;then echo "Error: \"$DAEMON\" refusing to start, dependency \"$DEPENDS\" not met" >&2;fi
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
stat_busy "Stopping $NAME"
|
||||
[ ! `get_pid_r $REQUIRED` ] && [ -n "$PID" ] && kill $PID &>/dev/null
|
||||
`get_pid_rr $REQUIRED` && [ -n "$PID" ] && kill $PID &>/dev/null
|
||||
if [ $? = 0 ]; then
|
||||
stat_done
|
||||
else
|
||||
stat_fail
|
||||
if [ `get_pid_r $REQUIRED` ];then echo "Error: Dependency \"$REQUIRED\" requires \"$DAEMON\", stop it first" >&2;fi
|
||||
if ! `get_pid_rr $REQUIRED`;then echo "Error: Dependency \"$REQUIRED\" requires \"$DAEMON\", stop it first" >&2;fi
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
@ -50,4 +44,4 @@ case "$1" in
|
|||
;;
|
||||
*)
|
||||
echo "usage: $0 {start|stop|restart}"
|
||||
esac
|
||||
esac
|
|
@ -2,44 +2,38 @@
|
|||
|
||||
. /etc/rc.conf
|
||||
. /etc/rc.d/functions
|
||||
. /etc/rc.d/netatalk common
|
||||
|
||||
NAME="AppleTalk Protocol Daemon"
|
||||
ARGS=
|
||||
DEPENDS=init
|
||||
DEPENDS=
|
||||
REQUIRED="a2boot papd timelord"
|
||||
DAEMON=`basename "$0"`
|
||||
DAEMON=atalkd
|
||||
|
||||
[ -r /etc/conf.d/$DAEMON ] && . /etc/conf.d/$DAEMON
|
||||
|
||||
PID=`get_pid $DAEMON`
|
||||
|
||||
get_pid_r() {
|
||||
local pid=()
|
||||
for i in $@
|
||||
do j=`get_pid $i` || return 1;pid+=($j);done
|
||||
echo ${pid[@]};
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
stat_busy "Starting $NAME"
|
||||
[ `get_pid_r $DEPENDS` ] && [ -z "$PID" ] && $DAEMON $ARGS &>/dev/null
|
||||
`get_pid_rd $DEPENDS` && [ -z "$PID" ] && $DAEMON $ARGS &>/dev/null
|
||||
if [ $? = 0 ]; then
|
||||
stat_done
|
||||
else
|
||||
stat_fail
|
||||
if [ ! `get_pid_r $DEPENDS` ];then echo "Error: \"$DAEMON\" refusing to start, dependency \"$DEPENDS\" not met" >&2;fi
|
||||
if ! `get_pid_rd $DEPENDS`;then echo "Error: \"$DAEMON\" refusing to start, dependency \"$DEPENDS\" not met" >&2;fi
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
stat_busy "Stopping $NAME"
|
||||
[ ! `get_pid_r $REQUIRED` ] && [ -n "$PID" ] && kill $PID &>/dev/null
|
||||
`get_pid_rr $REQUIRED` && [ -n "$PID" ] && kill $PID &>/dev/null
|
||||
if [ $? = 0 ]; then
|
||||
stat_done
|
||||
else
|
||||
stat_fail
|
||||
if [ `get_pid_r $REQUIRED` ];then echo "Error: Dependency \"$REQUIRED\" requires \"$DAEMON\", stop it first" >&2;fi
|
||||
if ! `get_pid_rr $REQUIRED`;then echo "Error: Dependency \"$REQUIRED\" requires \"$DAEMON\", stop it first" >&2;fi
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
@ -50,4 +44,4 @@ case "$1" in
|
|||
;;
|
||||
*)
|
||||
echo "usage: $0 {start|stop|restart}"
|
||||
esac
|
||||
esac
|
|
@ -1,53 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
. /etc/rc.conf
|
||||
. /etc/rc.d/functions
|
||||
|
||||
NAME="CNID Meta-Daemon"
|
||||
ARGS=
|
||||
DEPENDS=init
|
||||
REQUIRED=afpd
|
||||
DAEMON=`basename "$0"`
|
||||
|
||||
[ -r /etc/conf.d/$DAEMON ] && . /etc/conf.d/$DAEMON
|
||||
|
||||
PID=`get_pid $DAEMON`
|
||||
|
||||
get_pid_r() {
|
||||
local pid=()
|
||||
for i in $@
|
||||
do j=`get_pid $i` || return 1;pid+=($j);done
|
||||
echo ${pid[@]};
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
stat_busy "Starting $NAME"
|
||||
[ `get_pid_r $DEPENDS` ] && [ -z "$PID" ] && $DAEMON $ARGS &>/dev/null
|
||||
if [ $? = 0 ]; then
|
||||
stat_done
|
||||
else
|
||||
stat_fail
|
||||
if [ ! `get_pid_r $DEPENDS` ];then echo "Error: \"$DAEMON\" refusing to start, dependency \"$DEPENDS\" not met" >&2;fi
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
stat_busy "Stopping $NAME"
|
||||
[ ! `get_pid_r $REQUIRED` ] && [ -n "$PID" ] && kill $PID &>/dev/null
|
||||
if [ $? = 0 ]; then
|
||||
stat_done
|
||||
else
|
||||
stat_fail
|
||||
if [ `get_pid_r $REQUIRED` ];then echo "Error: Dependency \"$REQUIRED\" requires \"$DAEMON\", stop it first" >&2;fi
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
sleep 1
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "usage: $0 {start|stop|restart}"
|
||||
esac
|
47
aur/netatalk/cnid_metad.rc
Normal file
47
aur/netatalk/cnid_metad.rc
Normal file
|
@ -0,0 +1,47 @@
|
|||
#!/bin/bash
|
||||
|
||||
. /etc/rc.conf
|
||||
. /etc/rc.d/functions
|
||||
. /etc/rc.d/netatalk common
|
||||
|
||||
NAME="CNID Meta-Daemon"
|
||||
ARGS=
|
||||
DEPENDS=
|
||||
REQUIRED=afpd
|
||||
DAEMON=cnid_metad
|
||||
|
||||
[ -r /etc/conf.d/$DAEMON ] && . /etc/conf.d/$DAEMON
|
||||
|
||||
PID=`get_pid $DAEMON`
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
stat_busy "Starting $NAME"
|
||||
`get_pid_rd $DEPENDS` && [ -z "$PID" ] && $DAEMON $ARGS &>/dev/null
|
||||
if [ $? = 0 ]; then
|
||||
stat_done
|
||||
else
|
||||
stat_fail
|
||||
if ! `get_pid_rd $DEPENDS`;then echo "Error: \"$DAEMON\" refusing to start, dependency \"$DEPENDS\" not met" >&2;fi
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
stat_busy "Stopping $NAME"
|
||||
`get_pid_rr $REQUIRED` && [ -n "$PID" ] && kill $PID &>/dev/null
|
||||
if [ $? = 0 ]; then
|
||||
stat_done
|
||||
else
|
||||
stat_fail
|
||||
if ! `get_pid_rr $REQUIRED`;then echo "Error: Dependency \"$REQUIRED\" requires \"$DAEMON\", stop it first" >&2;fi
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
sleep 1
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "usage: $0 {start|stop|restart}"
|
||||
esac
|
|
@ -1,42 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
. /etc/rc.conf
|
||||
. /etc/rc.d/functions
|
||||
|
||||
NAME="NetATalk Meta-Daemon"
|
||||
DAEMON=`basename "$0"`
|
||||
RUNNING=()
|
||||
STOPPED=()
|
||||
|
||||
[ -r /etc/conf.d/$DAEMON ] && . /etc/conf.d/$DAEMON
|
||||
|
||||
for i in atalkd papd timelord a2boot cnid_metad afpd
|
||||
do
|
||||
if [ `type -p $i` ]; then if [ `get_pid $i` ]; then RUNNING+=($i); else STOPPED+=($i); fi; fi
|
||||
done
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
STARTING=''; rc.d start ${STOPPED[@]}
|
||||
if [ $? = 0 ]; then
|
||||
add_daemon $DAEMON
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
for ((i=${#RUNNING[@]}-1; i>=0; i--));do rc.d stop ${RUNNING[$i]}; done
|
||||
if [ $? = 0 ]; then
|
||||
rm_daemon $DAEMON
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
sleep 1
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "usage: $0 {start|stop|restart}"
|
||||
esac
|
|
@ -1,3 +1,18 @@
|
|||
2012-05-01 SJ_UnderWater
|
||||
|
||||
* 2.2.2-6 :
|
||||
moved to .rc files
|
||||
refactored PKGBUILD
|
||||
install rc.d files
|
||||
|
||||
2012-04-25 SJ_UnderWater
|
||||
|
||||
* 2.2.2-5 :
|
||||
init rebuild
|
||||
fix dep check
|
||||
fix get_pid
|
||||
function relocation
|
||||
|
||||
2012-04-21 SJ_UnderWater
|
||||
|
||||
* 2.2.2-4 :
|
||||
|
|
|
@ -14,3 +14,6 @@ post_upgrade() {
|
|||
echo '>>> /etc/avahi/services, please delete these';
|
||||
echo '>>> before restarting!';fi
|
||||
}
|
||||
pre_remove() {
|
||||
rc.d stop netatalk
|
||||
}
|
||||
|
|
63
aur/netatalk/netatalk.rc
Normal file
63
aur/netatalk/netatalk.rc
Normal file
|
@ -0,0 +1,63 @@
|
|||
#!/bin/bash
|
||||
|
||||
. /etc/rc.conf
|
||||
. /etc/rc.d/functions
|
||||
|
||||
NAME="NetATalk Meta-Daemon"
|
||||
DAEMON=netatalk
|
||||
RUNNING=()
|
||||
STOPPED=()
|
||||
|
||||
daemons() {
|
||||
for i in atalkd papd timelord a2boot cnid_metad afpd; do
|
||||
if [ `type -p $i` ]; then if [ "`get_pid $i`" ]; then RUNNING+=($i); else STOPPED+=($i); fi; fi
|
||||
done
|
||||
}
|
||||
get_pid_r() {
|
||||
local pid=0;for i in $@
|
||||
do get_pid $i >/dev/null || continue;: $[ pid++ ];done
|
||||
return $pid
|
||||
}
|
||||
get_pid_rd(){
|
||||
get_pid_r $*
|
||||
if [ "$?" -ne "$#" ];then return 1;fi
|
||||
}
|
||||
get_pid_rr(){
|
||||
get_pid_r $*
|
||||
if [ "$?" -ne "0" ];then return 1;fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop)
|
||||
[ -r /etc/conf.d/$DAEMON ] && . /etc/conf.d/$DAEMON
|
||||
daemons
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
STARTING=''; rc.d start ${STOPPED[@]}
|
||||
if [ $? = 0 ]; then
|
||||
add_daemon $DAEMON
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
for ((i=${#RUNNING[@]}-1; i>=0; i--));do rc.d stop ${RUNNING[$i]}; done
|
||||
if [ $? = 0 ]; then
|
||||
rm_daemon $DAEMON
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
sleep 1
|
||||
$0 start
|
||||
;;
|
||||
common)
|
||||
;;
|
||||
*)
|
||||
echo "usage: $0 {start|stop|restart}"
|
||||
esac
|
|
@ -2,44 +2,38 @@
|
|||
|
||||
. /etc/rc.conf
|
||||
. /etc/rc.d/functions
|
||||
. /etc/rc.d/netatalk common
|
||||
|
||||
NAME="AppleTalk Printer Daemon"
|
||||
ARGS=
|
||||
DEPENDS=atalkd
|
||||
REQUIRED=
|
||||
DAEMON=`basename "$0"`
|
||||
DAEMON=papd
|
||||
|
||||
[ -r /etc/conf.d/$DAEMON ] && . /etc/conf.d/$DAEMON
|
||||
|
||||
PID=`get_pid $DAEMON`
|
||||
|
||||
get_pid_r() {
|
||||
local pid=()
|
||||
for i in $@
|
||||
do j=`get_pid $i` || return 1;pid+=($j);done
|
||||
echo ${pid[@]};
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
stat_busy "Starting $NAME"
|
||||
[ `get_pid_r $DEPENDS` ] && [ -z "$PID" ] && $DAEMON $ARGS &>/dev/null
|
||||
`get_pid_rd $DEPENDS` && [ -z "$PID" ] && $DAEMON $ARGS &>/dev/null
|
||||
if [ $? = 0 ]; then
|
||||
stat_done
|
||||
else
|
||||
stat_fail
|
||||
if [ ! `get_pid_r $DEPENDS` ];then echo "Error: \"$DAEMON\" refusing to start, dependency \"$DEPENDS\" not met" >&2;fi
|
||||
if ! `get_pid_rd $DEPENDS`;then echo "Error: \"$DAEMON\" refusing to start, dependency \"$DEPENDS\" not met" >&2;fi
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
stat_busy "Stopping $NAME"
|
||||
[ ! `get_pid_r $REQUIRED` ] && [ -n "$PID" ] && kill $PID &>/dev/null
|
||||
`get_pid_rr $REQUIRED` && [ -n "$PID" ] && kill $PID &>/dev/null
|
||||
if [ $? = 0 ]; then
|
||||
stat_done
|
||||
else
|
||||
stat_fail
|
||||
if [ `get_pid_r $REQUIRED` ];then echo "Error: Dependency \"$REQUIRED\" requires \"$DAEMON\", stop it first" >&2;fi
|
||||
if ! `get_pid_rr $REQUIRED`;then echo "Error: Dependency \"$REQUIRED\" requires \"$DAEMON\", stop it first" >&2;fi
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
@ -50,4 +44,4 @@ case "$1" in
|
|||
;;
|
||||
*)
|
||||
echo "usage: $0 {start|stop|restart}"
|
||||
esac
|
||||
esac
|
|
@ -2,44 +2,38 @@
|
|||
|
||||
. /etc/rc.conf
|
||||
. /etc/rc.d/functions
|
||||
. /etc/rc.d/netatalk common
|
||||
|
||||
NAME="AppleTalk Time Daemon"
|
||||
ARGS=
|
||||
DEPENDS=atalkd
|
||||
REQUIRED=
|
||||
DAEMON=`basename "$0"`
|
||||
DAEMON=timelord
|
||||
|
||||
[ -r /etc/conf.d/$DAEMON ] && . /etc/conf.d/$DAEMON
|
||||
|
||||
PID=`get_pid $DAEMON`
|
||||
|
||||
get_pid_r() {
|
||||
local pid=()
|
||||
for i in $@
|
||||
do j=`get_pid $i` || return 1;pid+=($j);done
|
||||
echo ${pid[@]};
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
stat_busy "Starting $NAME"
|
||||
[ `get_pid_r $DEPENDS` ] && [ -z "$PID" ] && $DAEMON $ARGS &>/dev/null
|
||||
`get_pid_rd $DEPENDS` && [ -z "$PID" ] && $DAEMON $ARGS &>/dev/null
|
||||
if [ $? = 0 ]; then
|
||||
stat_done
|
||||
else
|
||||
stat_fail
|
||||
if [ ! `get_pid_r $DEPENDS` ];then echo "Error: \"$DAEMON\" refusing to start, dependency \"$DEPENDS\" not met" >&2;fi
|
||||
if ! `get_pid_rd $DEPENDS`;then echo "Error: \"$DAEMON\" refusing to start, dependency \"$DEPENDS\" not met" >&2;fi
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
stat_busy "Stopping $NAME"
|
||||
[ ! `get_pid_r $REQUIRED` ] && [ -n "$PID" ] && kill $PID &>/dev/null
|
||||
`get_pid_rr $REQUIRED` && [ -n "$PID" ] && kill $PID &>/dev/null
|
||||
if [ $? = 0 ]; then
|
||||
stat_done
|
||||
else
|
||||
stat_fail
|
||||
if [ `get_pid_r $REQUIRED` ];then echo "Error: Dependency \"$REQUIRED\" requires \"$DAEMON\", stop it first" >&2;fi
|
||||
if ! `get_pid_rr $REQUIRED`;then echo "Error: Dependency \"$REQUIRED\" requires \"$DAEMON\", stop it first" >&2;fi
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
@ -50,4 +44,4 @@ case "$1" in
|
|||
;;
|
||||
*)
|
||||
echo "usage: $0 {start|stop|restart}"
|
||||
esac
|
||||
esac
|
Loading…
Reference in a new issue