Which packages should not be updated?

This forum is for all other ARMv5 devices

Which packages should not be updated?

Postby silentcreek » Wed Feb 06, 2013 9:48 am

Hi,

yesterday I was quite astonished and dissappointed that a simple system update can leave you with a device that is not working properly anymore. In my case, samba didn't work anymore and it took me 2 hours to figure out why and how to fix it.
As I found out on this forum, the initscript for samba was removed during the last update and this will happen to more and more packages in the future.

I would have expected that packages that are not compatible with our systems wouldn't have been updated at all ( just like we don't get a new kernel since the newer ones don't work on our devices). But anyway, to prevent such problems in the future, I would like to start to collect information on all the packages that one should not update because neccesary initscripts are being removed or other complications. I hope this will become a constantly updated thread with helpful information for all owners of OXNAS based devices. And if it does become a valueable source of information, maybe someone can mark this topic sticky, etc.

So, from which packages the initscripts have been removed already? What can you do about it?

Regards,

Timo
silentcreek
 
Posts: 21
Joined: Mon Jan 07, 2013 8:38 pm

Re: Which packages should not be updated?

Postby darkside401 » Thu Feb 07, 2013 8:19 am

I just opened a thread in the Packages subforum viewtopic.php?f=15&t=5008

I dont know why it is necessary to remove the init scrips from the packages, but if that goes on it wont be possible to run ALARM on the Oxnas devices without much effort reinstalling old init- scripts etc.
darkside401
 
Posts: 14
Joined: Fri Jan 11, 2013 10:18 am

Re: Which packages should not be updated?

Postby silentcreek » Thu Feb 07, 2013 1:33 pm

Well, I hear you, but it seems the people form alarm won't be able to do much about it because this is a decision my the developers of ArchLinux.

Any, as for now, I know of three packages where the init scripts have been removed. So let's start collecting information about them:
samba
sabnzbd

For samba: the solution can be found here.
silentcreek
 
Posts: 21
Joined: Mon Jan 07, 2013 8:38 pm

Re: Which packages should not be updated?

Postby sethjvm » Sat Feb 09, 2013 6:12 pm

Pogo Plug Pro with ALARM SATA rootfs
success: wireless, samba, sabnzbd, sickbeard, transmission, lamp with Gallery3 and newznab+, rsync server, tor
still trying: avahi, minidlna
up next: asterisk, openvpn, proxy server of some sort
gave up: nfs and lvm
sethjvm
 
Posts: 53
Joined: Wed Oct 19, 2011 7:36 am

Re: Which packages should not be updated?

Postby Geoff » Mon Feb 11, 2013 5:29 am

It looks like dovecot just lost its rc.d script with today's upgrade to 2.1.15-1 ... here's the old script:

$this->bbcode_second_pass_code('', '
#!/bin/bash

daemon_name=dovecot

. /etc/rc.conf
. /etc/rc.d/functions
#. /etc/conf.d/$daemon_name.conf

get_pid() {
pidof -o %PPID $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
[[ -n $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
;;

status)
stat_busy "Checking $daemon_name status";
ck_status $daemon_name
;;

*)
echo "usage: $0 {start|stop|restart|status}"
esac

exit 0')
Edit (2/14): Now openvpn has lost its rc.d scripts, so here are the old scripts.
/etc/rc.d/openvpn
$this->bbcode_second_pass_code('', '
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

CFGDIR="/etc/openvpn"
STATEDIR="/var/run/openvpn"

case "$1" in
start)
stat_busy "Starting OpenVPN ... "
success=0
mkdir -p "${STATEDIR}"
for cfg in "${CFGDIR}"/*.conf; do
stat_append "$(basename "${cfg}" .conf) "
/usr/sbin/openvpn --daemon --writepid "${STATEDIR}"/"$(basename "${cfg}" .conf)".pid --cd "${CFGDIR}" --config "${cfg}" || success=$?
done
if [ $success -eq 0 ]; then
add_daemon openvpn
stat_done
else
stat_fail
fi
;;
stop)
stat_busy "Stopping OpenVPN ..."
for pidfile in "${STATEDIR}"/*.pid; do
stat_append "$(basename "${pidfile}" .pid) "
kill $(cat "${pidfile}" 2>/dev/null) 2>/dev/null
rm -f "${pidfile}"
done
rm_daemon openvpn
stat_done
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0')
/etc/rc.d/openvpn-tapdev
$this->bbcode_second_pass_code('', '
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

. /etc/conf.d/openvpn-tapdev

case "$1" in
start)
stat_busy "Creating tap devices for OpenVPN ... "
success=0
for tapdev in ${TAPDEVS}; do
stat_append "${tapdev} "
/usr/sbin/openvpn --mktun --dev-type tap --dev ${tapdev} >/dev/null 2>&1 || success=$?
done
if [ $success -eq 0 ]; then
add_daemon openvpn-tapdev
stat_done
else
stat_fail
fi
;;
stop)
stat_busy "Destroying tap devices for OpenVPN ..."
for tapdev in ${TAPDEVS}; do
stat_append "${tapdev} "
/usr/sbin/openvpn --rmtun --dev-type tap --dev ${tapdev} >/dev/null 2>&1 || success=$?
done
rm_daemon openvpn-tapdev
stat_done
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0')
/etc/conf.d/openvpn-tapdev
$this->bbcode_second_pass_code('', '
#
# /etc/conf.d/openvpn-tapdev
#
# Place openvpn-tapdev before network into your DAEMONS array
# This will create permanent tap devices which you can use for bridging
#
# Example:
# TAPDEVS="work home"
# Will create two tap devices "work" and "home"
#

TAPDEVS=""')
Edit (2/22): Now git-daemon has lost its rc.d scripts, so here are the old scripts.
/etc/rc.d/git-daemon
$this->bbcode_second_pass_code('', '
#!/bin/bash

daemon_bin="/usr/lib/git-core/git-daemon"
daemon_name=$(basename $daemon_bin)
PIDF="/var/run/$daemon_name.pid"

. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/$daemon_name.conf

get_pid() {
pidof -o %PPID $daemon_name
}

case "$1" in
start)
stat_busy "Starting $daemon_name daemon"

PID=$(get_pid)
if [ -z "$PID" ]; then
[ -f $PIDF ] && rm -f $PIDF
# RUN
$daemon_bin --pid-file=$PIDF $GIT_DAEMON_ARGS
#
if [ $? -gt 0 ]; then
stat_fail
exit 1
else
echo $(get_pid) > $PIDF
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 $PIDF &> /dev/null
rm_daemon $daemon_name
stat_done
fi
;;

restart)
$0 stop
sleep 3
$0 start
;;

status)
stat_busy "Checking $daemon_name status";
ck_status $daemon_name
;;

*)
echo "usage: $0 {start|stop|restart|status}"
esac

exit 0')
/etc/conf.d/git-daemon.conf
$this->bbcode_second_pass_code('', '
# path to git repositories served
GIT_REPO="/srv/git/"
# see `man git-daemon` for all available options
# $GIT_REPO will be present twice in most configs
GIT_DAEMON_ARGS="--detach --syslog --verbose --base-path=$GIT_REPO $GIT_REPO"')
Edit (2/27): For what it's worth, another file that went missing is /etc/conf.d/samba
$this->bbcode_second_pass_code('', '#
# Configuration for the samba init script
#

# space separated list of daemons to launch
SAMBA_DAEMONS=(smbd nmbd)
#SAMBA_DAEMONS=(smbd nmbd winbindd)')
Edit (3/8): Now syslog-ng has lost its rc.d scripts, so here are the old scripts.
/etc/rc.d/syslog-ng
$this->bbcode_second_pass_code('', '
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/syslog-ng

checkconfig() {
if ! syslog-ng -s "${SYSLOG_NG_CHECKOPTS[@]}"; then
stat_fail
exit 1
fi
}

pidfile=/run/syslog-ng.pid
if [[ -r $pidfile ]]; then
read -r PID < "$pidfile"
if [[ $PID && ! -d /proc/$PID ]]; then
# stale pidfile
unset PID
rm -f "$pidfile"
fi
fi

case $1 in
start)
stat_busy "Starting Syslog-NG"
checkconfig
if [[ -z $PID ]] && /usr/bin/syslog-ng "${SYSLOG_NG_OPTS[@]}"; then
add_daemon syslog-ng
stat_done
else
stat_fail
exit 1
fi
;;
stop)
stat_busy "Stopping Syslog-NG"
if [[ $PID ]] && kill $PID &>/dev/null; then
rm_daemon syslog-ng
stat_done
else
stat_fail
exit 1
fi
;;
reload)
stat_busy "Reloading Syslog-NG configuration and re-opening log files"
if [[ -z $PID ]]; then
stat_fail
else
checkconfig
if kill -HUP $PID &>/dev/null; then
stat_done
else
stat_fail
exit 1
fi
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart|reload}"
esac')
/etc/conf.d/syslog-ng
$this->bbcode_second_pass_code('', '
#
# /etc/conf.d/syslog-ng
#

# passed to syslog-ng on config check
SYSLOG_NG_CHECKOPTS=()

# passed to syslog-ng at startup
SYSLOG_NG_OPTS=()')
Edit (3/20): Now cups has lost its rc.d script, so here it is.
/etc/rc.d/cupsd
$this->bbcode_second_pass_code('', '
#!/bin/bash

daemon_name=cupsd

. /etc/rc.conf
. /etc/rc.d/functions
#. /etc/conf.d/$daemon_name.conf

get_pid() {
pidof -o %PPID $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
;;

status)
stat_busy "Checking $daemon_name status";
ck_status $daemon_name
;;

*)
echo "usage: $0 {start|stop|restart|status}"
esac

exit 0')
Edit (3/27): Now lighttpd has lost its rc.d script, so here it is.
/etc/rc.d/lighttpd
$this->bbcode_second_pass_code('', '
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions


pid_file='/run/lighttpd/lighttpd-angel.pid'

get_pid() {
if [ -r "${pid_file}" ]; then
cat "${pid_file}"
else
pgrep -f /usr/bin/lighttpd-angel
fi
}

test_config() {
stat_busy 'Checking configuration'
if [ $(id -u) -ne 0 ]; then
stat_append '(This script must be run as root)'
stat_die
fi

if [ ! -r /etc/lighttpd/lighttpd.conf ]; then
stat_append '(/etc/lighttpd/lighttpd.conf not found)'
stat_die
fi

/usr/bin/lighttpd -t -f /etc/lighttpd/lighttpd.conf >/dev/null 2>&1
if [ $? -gt 0 ]; then
stat_append '(error in /etc/lighttpd/lighttpd.conf)'
stat_die
fi

stat_done
}

start() {
stat_busy 'Starting lighttpd'

local PID=$(get_pid)
if [ -z "$PID" ]; then
nohup /usr/bin/lighttpd-angel -D -f /etc/lighttpd/lighttpd.conf >>/var/log/lighttpd/lighttpd-angel.log 2>&1 &
if [ $? -gt 0 ]; then
stat_die
else
echo $! > "${pid_file}"
add_daemon lighttpd
stat_done
fi
else
stat_die
fi
}

stop() {
stat_busy 'Stopping lighttpd'
local PID=$(get_pid)
[ -n "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
[ -f "${pid_file}" ] && rm -f "${pid_file}"
rm_daemon lighttpd
stat_done
fi
}

gracefull-stop() {
stat_busy 'Stopping lighttpd gracefully'
local PID=$(get_pid)
[ -n "$PID" ] && kill -INT $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
[ -f "${pid_file}" ] && rm -f "${pid_file}"
rm_daemon lighttpd
stat_done
fi
}

reload() {
stat_busy 'Reloading lighttpd'
local PID=$(get_pid)
[ -n "$PID" ] && kill -HUP $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_die
else
stat_done
fi
}


case "$1" in
start)
test_config
start
;;
stop)
test_config
stop
;;
gracefull-stop)
test_config
stop
;;
reload)
test_config
reload
;;
restart)
test_config
stop
while [ -n "$(get_pid)" ]; do
sleep 1
done
start
;;
status)
stat_busy 'Checking lighttpd status'
ck_status lighttpd
;;
*)
echo "usage: $0 {start|stop|gracefull-stop|reload|restart|status}"
esac

exit 0')
Edit (4/15): Now snmpd has lost its rc.d scripts, so here are the old scripts.
/etc/rc.d/snmpd
$this->bbcode_second_pass_code('', '
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/snmpd

PID=`pidof -o %PPID /usr/bin/snmpd`
case "$1" in
start)
stat_busy "Starting Net-SNMP"
[ -z "$PID" ] && /usr/bin/snmpd $SNMPD_ARGS
if [ $? -gt 0 ]; then
stat_fail
else
echo $PID > /var/run/snmpd.pid
add_daemon snmpd
stat_done
fi
;;
stop)
stat_busy "Stopping Net-SNMP"
[ ! -z "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm /var/run/snmpd.pid
rm_daemon snmpd
stat_done
fi
;;
restart)
$0 stop
sleep 2
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0')
/etc/conf.d/snmpd
$this->bbcode_second_pass_code('', '
#
# Parameters to be passed to snmpd
#
SNMPD_ARGS=""')
Edit (4/16): Now gpm has lost its rc.d scripts, so here are the old scripts.
/etc/rc.d/gpm
$this->bbcode_second_pass_code('', '
#!/bin/bash

# source application-specific settings
GPM_ARGS=
[ -f /etc/conf.d/gpm ] && . /etc/conf.d/gpm

. /etc/rc.conf
. /etc/rc.d/functions

PID=$(pidof -o %PPID /usr/bin/gpm)
case "$1" in
start)
stat_busy "Starting GPM Daemon"
[ -z "$PID" ] && /usr/bin/gpm ${GPM_ARGS}
PID=$(pidof -o %PPID /usr/bin/gpm)
if [ -z "$PID" ]; then
stat_fail
else
add_daemon gpm
stat_done
fi
;;
stop)
stat_busy "Stopping GPM Daemon"
[ ! -z "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon gpm
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0')
/etc/conf.d/gpm
$this->bbcode_second_pass_code('', '
#
# Parameters to be passed to gpm
#
GPM_ARGS="-m /dev/input/mice -t imps2"')
Edit (5/8): Now nfs has lost its rc.d scripts, so here are the old scripts.
/etc/rc.d/nfs-common
$this->bbcode_second_pass_code('', '
#!/bin/bash

daemon_name=nfs-common

NEED_STATD=
STATD_OPTS=
NEED_IDMAPD=
IDMAPD_OPTS=
NEED_GSSD=
GSSD_OPTS=
PIPEFS_MOUNTPOINT=
PIPEFS_MOUNTOPTS=

# rpc.statd daemon & binary location
STATD_DAEMON_NAME=rpc.statd
STATD="/usr/sbin/rpc.statd"

# rpc.idmapd daemon & binary location
IDMAPD_DAEMON_NAME=rpc.idmapd
IDMAPD="/usr/sbin/rpc.idmapd"

# rpc.gssd daemon & binary location
GSSD_DAEMON_NAME=rpc.gssd
GSSD="/usr/sbin/rpc.gssd"

. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/$daemon_name.conf

# Default mountpoint and options for rpc_pipefs filesystem
[ -z "$PIPEFS_MOUNTPOINT" ] && PIPEFS_MOUNTPOINT="/var/lib/nfs/rpc_pipefs"
[ -z "$PIPEFS_MOUNTOPTS" ] && PIPEFS_MOUNTOPTS="defaults"

# Parse the fstab file, and determine whether we need idmapd and gssd. (The
# /etc/conf.d/nfs-common settings, if any, will override our autodetection.)
AUTO_NEED_IDMAPD=no
AUTO_NEED_GSSD=no

if [ -f /etc/fstab ]; then
exec 9<&0 </etc/fstab

while read DEV MTPT FSTYPE OPTS REST; do
if [ "$FSTYPE" = "nfs4" ]; then
AUTO_NEED_IDMAPD=yes
fi
case "$OPTS" in
sec=krb5|*,sec=krb5|sec=krb5,*|*,sec=krb5i,*|sec=krb5i|*,sec=krb5i|sec=krb5i,*|*,sec=krb5i,*|sec=krb5p|*,sec=krb5p|sec=krb5p,*|*,sec=krb5p,*)
AUTO_NEED_GSSD=yes
;;
esac
done

exec 0<&9 9<&-
fi

# We also need idmapd if we run an NFSv4 server. It's fairly difficult
# to autodetect whether there are NFSv4 exports or not, and idmapd is not a
# particularily heavy daemon, so we auto-enable it if we find an /etc/exports
# file. This does not mean that there are NFSv4 or other mounts active (or
# even that nfs-kernel-server is installed), but it matches what the "start"
# condition in nfs-kernel-server's init script does, which has a value in
# itself.
if [ -f /etc/exports ] && grep -q '^[[:space:]]*[^#]*/' /etc/exports; then
AUTO_NEED_IDMAPD=yes
fi

case "$NEED_STATD" in
yes|no)
;;
*)
NEED_STATD=yes
;;
esac

case "$NEED_IDMAPD" in
yes|no)
;;
*)
NEED_IDMAPD=$AUTO_NEED_IDMAPD
;;
esac

case "$NEED_GSSD" in
yes|no)
;;
*)
NEED_GSSD=$AUTO_NEED_GSSD
;;
esac

do_modprobe() {
if [ -x /sbin/modprobe -a -f /proc/modules ]; then
modprobe -q "$1" || true
fi
}

do_mount() {
if ! grep -E "$1\$" /proc/filesystems &> /dev/null ; then
return 1
fi

if grep -vw "$1" /proc/mounts &> /dev/null ; then
if ! mountpoint -q "$2" ; then
mount -t "$1" "$1" "$2" -o "$3"
return
fi
fi
return 0
}

do_umount() {
if mountpoint -q "$1" ; then
umount "$1"
fi
return 0
}

get_pid() {
pidof -o %PPID "$1"
}

case "$1" in
start)
ck_daemon rpcbind && { echo -n "Start rpcbind first." >&2; stat_die; }
rc=0
if [ "$NEED_STATD" = yes ]; then
stat_busy "Starting $STATD_DAEMON_NAME daemon"
PID=$(get_pid $STATD)
if [ -z "$PID" ]; then
[ -f /var/run/$STATD_DAEMON_NAME.pid ] && rm -f /var/run/$STATD_DAEMON_NAME.pid
# RUN
$STATD $STATD_OPTS
#
rc=$(($rc+$?))
if [ $rc -gt 0 ]; then
stat_fail
exit $rc
else
echo $(get_pid $STATD) > /var/run/$STATD_DAEMON_NAME.pid
stat_done
fi
else
stat_fail
exit 1
fi
# Run sm-notify
/usr/sbin/sm-notify $SMNOTIFY_OPTS
fi

if [ "$NEED_IDMAPD" = yes ] || [ "$NEED_GSSD" = yes ]; then
stat_busy "Mounting pipefs filesystem"
do_modprobe sunrpc
do_modprobe nfs
do_modprobe nfsd
do_mount rpc_pipefs "$PIPEFS_MOUNTPOINT" "$PIPEFS_MOUNTOPTS"
rc=$(($rc+$?))
if [ $rc -gt 0 ]; then
stat_fail
exit $rc
else
stat_done
fi

if [ "$NEED_IDMAPD" = yes ]; then
stat_busy "Starting $IDMAPD_DAEMON_NAME daemon"
PID=$(get_pid $IDMAPD)
if [ -z "$PID" ]; then
[ -f /var/run/$IDMAPD_DAEMON_NAME.pid ] && rm -f /var/run/$IDMAPD_DAEMON_NAME.pid
# RUN
$IDMAPD $IDMAPD_OPTS
#
rc=$(($rc+$?))
if [ $rc -gt 0 ]; then
stat_fail
exit $rc
else
echo $(get_pid $IDMAPD) > /var/run/$IDMAPD_DAEMON_NAME.pid
stat_done
fi
else
stat_fail
exit 1
fi
fi

if [ "$NEED_GSSD" = yes ]; then
do_modprobe rpcsec_gss_krb5
stat_busy "Starting $GSSD_DAEMON_NAME daemon"
PID=$(get_pid $GSSD)
if [ -z "$PID" ]; then
[ -f /var/run/$GSSD_DAEMON_NAME.pid ] && rm -f /var/run/$GSSD_DAEMON_NAME.pid
# RUN
$GSSD $GSSD_OPTS
#
rc=$(($rc+$?))
if [ $rc -gt 0 ]; then
stat_fail
exit $rc
else
echo $(get_pid $GSSD) > /var/run/$GSSD_DAEMON_NAME.pid
stat_done
fi
else
stat_fail
exit 1
fi
fi
fi

add_daemon $daemon_name
;;

stop)
rc=0
if [ "$NEED_IDMAPD" = yes ] || [ "$NEED_GSSD" = yes ]; then

if [ "$NEED_GSSD" = yes ]; then
stat_busy "Stopping $GSSD_DAEMON_NAME daemon"
PID=$(get_pid $GSSD)
# KILL
[ ! -z "$PID" ] && kill $PID &> /dev/null
#
rc=$(($rc+$?))
if [ $rc -gt 0 ]; then
stat_fail
exit $rc
else
rm -f /var/run/$GSSD_DAEMON_NAME.pid &> /dev/null
stat_done
fi
fi

if [ "$NEED_IDMAPD" = yes ]; then
stat_busy "Stopping $IDMAPD_DAEMON_NAME daemon"
PID=$(get_pid $IDMAPD)
# KILL
[ ! -z "$PID" ] && kill $PID &> /dev/null
#
rc=$(($rc+$?))
if [ $rc -gt 0 ]; then
stat_fail
exit $rc
else
rm -f /var/run/$IDMAPD_DAEMON_NAME.pid &> /dev/null
stat_done
fi
fi
do_umount "$PIPEFS_MOUNTPOINT" 2>/dev/null || true
fi

if [ "$NEED_STATD" = yes ]; then
stat_busy "Stopping $STATD_DAEMON_NAME daemon"
PID=$(get_pid $STATD)
# KILL
[ ! -z "$PID" ] && kill $PID &> /dev/null
#
rc=$(($rc+$?))
if [ $rc -gt 0 ]; then
stat_fail
exit $rc
else
rm -f /var/run/$STATD_DAEMON_NAME.pid &> /dev/null
stat_done
fi
fi

rm_daemon $daemon_name
;;

status)
stat_busy "Checking $daemon_name status";
ck_status $daemon_name

if [ "$NEED_STATD" = yes ]; then
stat_busy "Daemon $STATD_DAEMON_NAME running"
PID=$(get_pid $STATD)
if [ -z "$PID" ]; then
stat_fail
else
stat_done
fi
fi

if [ "$NEED_GSSD" = yes ]; then
stat_busy "Daemon $GSSD_DAEMON_NAME running"
PID=$(get_pid $GSSD)
if [ -z "$PID" ]; then
stat_fail
else
stat_done
fi
fi

if [ "$NEED_IDMAPD" = yes ]; then
stat_busy "Daemon $IDMAPD_DAEMON_NAME running"
PID=$(get_pid $IDMAPD)
if [ -z "$PID" ]; then
stat_fail
else
stat_done
fi
fi
echo
;;

restart)
$0 stop
sleep 3
$0 start
;;
*)
echo "usage: $0 {start|stop|status|restart}"
esac
exit 0')
/etc/rc.d/nfs-server
$this->bbcode_second_pass_code('', '
#!/bin/bash

daemon_name=nfs-server

NFSD_COUNT=
NFSD_OPTS=
NEED_SVCGSSD=
SVCGSSD_OPTS=
MOUNTD_OPTS=
PROCNFSD_MOUNTPOINT=
PROCNFSD_MOUNTOPTS=

# rpc.nfsd daemon & binary location
NFSD_PROCESS_NAME=nfsd
NFSD_DAEMON_NAME=rpc.nfsd
NFSD="/usr/sbin/rpc.nfsd"

# rpc.svcgssd daemon & binary location
SVCGSSD_DAEMON_NAME=rpc.svcgssd
SVCGSSD="/usr/sbin/rpc.svcgssd"

# rpc.idmapd daemon & binary location
IDMAPD_DAEMON_NAME=rpc.idmapd
IDMAPD="/usr/sbin/rpc.idmapd"

# rpc.mountd daemon & binary location
MOUNTD_DAEMON_NAME=rpc.mountd
MOUNTD="/usr/sbin/rpc.mountd"

# exortfs binary location
EXPORTFS="/usr/sbin/exportfs"

. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/$daemon_name.conf

# Default number of nfsd servers
[ -z "$NFSD_COUNT" ] && NFSD_COUNT=8

# Default mountpoint and options for nfsd filesystem
[ -z "$PROCNFSD_MOUNTPOINT" ] && PROCNFSD_MOUNTPOINT="/proc/fs/nfsd"
[ -z "$PROCNFSD_MOUNTOPTS" ] && PROCNFSD_MOUNTOPTS="rw,nodev,noexec,nosuid"

case "$NEED_SVCGSSD" in
yes|no)
;;
*)
NEED_SVCGSSD=no
;;
esac

do_modprobe() {
if [ -x /sbin/modprobe -a -f /proc/modules ]; then
modprobe -q "$1" || true
fi
}

do_mount() {
if ! grep -E "$1\$" /proc/filesystems &> /dev/null ; then
return 1
fi

if grep -vw "$1" /proc/mounts &> /dev/null ; then
if ! mountpoint -q "$2" ; then
mount -t "$1" "$1" "$2" -o "$3"
return
fi
fi
return 0
}

do_umount() {
if mountpoint -q "$1" ; then
umount "$1"
fi
return 0
}

get_pid() {
pidof -o %PPID "$1"
}

case "$1" in
start)
ck_daemon nfs-common && { echo -n "Start nfs-common first." >&2; stat_die; }
rc=0
stat_busy "Mounting nfsd filesystem"
do_modprobe nfsd
do_mount nfsd "$PROCNFSD_MOUNTPOINT" "$PROCNFSD_MOUNTOPTS"
rc=$(($rc+$?))
if [ $rc -gt 0 ]; then
stat_fail
exit $rc
else
stat_done
fi

stat_busy "Exporting all directories"
$EXPORTFS -r
rc=$(($rc+$?))
if [ $rc -gt 0 ]; then
stat_fail
exit $rc
else
stat_done
fi

stat_busy "Starting $NFSD_DAEMON_NAME daemon"
PID=$(get_pid $NFSD_PROCESS_NAME)
if [ -z "$PID" ]; then
[ -f /var/run/$NFSD_DAEMON_NAME.pid ] && rm -f /var/run/$NFSD_DAEMON_NAME.pid
# RUN
$NFSD $NFSD_OPTS $NFSD_COUNT
#
rc=$(($rc+$?))
if [ $rc -gt 0 ]; then
stat_fail
exit $rc
else
echo $(get_pid $NFSD_PROCESS_NAME) > /var/run/$NFSD_DAEMON_NAME.pid
stat_done
fi
else
stat_fail
exit 1
fi

if [ "$NEED_SVCGSSD" = yes ]; then
do_modprobe rpcsec_gss_krb5
stat_busy "Starting $SVCGSSD_DAEMON_NAME daemon"
PID=$(get_pid $SVCGSSD)
if [ -z "$PID" ]; then
[ -f /var/run/$SVCGSSD_DAEMON_NAME.pid ] && rm -f /var/run/$SVCGSSD_DAEMON_NAME.pid
# RUN
$SVCGSSD $SVCGSSD_OPTS
#
rc=$(($rc+$?))
if [ $rc -gt 0 ]; then
stat_fail
exit $rc
else
echo $(get_pid $SVCGSSD) > /var/run/$SVCGSSD_DAEMON_NAME.pid
stat_done
fi
else
stat_fail
exit 1
fi
fi

PID=$(get_pid $IDMAPD)
[ ! -z "$PID" ] && kill -SIGHUP $IDMAPD_DAEMON_NAME &> /dev/null

stat_busy "Starting $MOUNTD_DAEMON_NAME daemon"
PID=$(get_pid $MOUNTD)
if [ -z "$PID" ]; then
[ -f /var/run/$MOUNTD_DAEMON_NAME.pid ] && rm -f /var/run/$MOUNTD_DAEMON_NAME.pid
# RUN
$MOUNTD $MOUNTD_OPTS
#
rc=$(($rc+$?))
if [ $rc -gt 0 ]; then
stat_fail
exit $rc
else
echo $(get_pid $MOUNTD) > /var/run/$MOUNTD_DAEMON_NAME.pid
stat_done
fi
else
stat_fail
exit 1
fi

add_daemon $daemon_name
;;

stop)
rc=0
stat_busy "Stopping $MOUNTD_DAEMON_NAME daemon"
PID=$(get_pid $MOUNTD)
# KILL
[ ! -z "$PID" ] && kill $PID &> /dev/null
#
rc=$(($rc+$?))
if [ $rc -gt 0 ]; then
stat_fail
exit $rc
else
rm -f /var/run/$MOUNTD_DAEMON_NAME.pid &> /dev/null
stat_done
fi

if [ "$NEED_SVCGSSD" = yes ]; then
stat_busy "Stopping $SVCGSSD_DAEMON_NAME daemon"
PID=$(get_pid $SVCGSSD)
# KILL
[ ! -z "$PID" ] && kill $PID &> /dev/null
#
rc=$(($rc+$?))
if [ $rc -gt 0 ]; then
stat_fail
exit $rc
else
rm -f /var/run/$SVCGSSD_DAEMON_NAME.pid &> /dev/null
stat_done
fi
fi

stat_busy "Stopping $NFSD_DAEMON_NAME daemon"
PID=$(get_pid $NFSD_PROCESS_NAME)
# KILL (SIGINT)
[ ! -z "$PID" ] && kill -2 $PID &> /dev/null
#
rc=$(($rc+$?))
if [ $rc -gt 0 ]; then
stat_fail
exit $rc
else
sleep 1
PID=$(get_pid $NFSD_PROCESS_NAME)
# KILL (KILL) - just to be sure
[ ! -z "$PID" ] && kill -9 $PID &> /dev/null
#
rm -f /var/run/$NFSD_DAEMON_NAME.pid &> /dev/null
stat_done
fi

stat_busy "Unexporting all directories"
$EXPORTFS -au
rc=$(($rc+$?))
if [ $rc -gt 0 ]; then
stat_fail
exit $rc
else
stat_done
fi

# flush everything out of the kernels export table
if mountpoint -q "$PROCNFSD_MOUNTPOINT" ; then
$EXPORTFS -f
fi
do_umount "$PROCNFSD_MOUNTPOINT" 2>/dev/null || true
rm_daemon $daemon_name
;;

status)
stat_busy "Checking $daemon_name status";
ck_status $daemon_name

stat_busy "Daemon $NFSD_DAEMON_NAME running"
PID=$(get_pid $NFSD_PROCESS_NAME)
if [ -z "$PID" ]; then
stat_fail
else
stat_done
fi

stat_busy "Daemon $MOUNTD_DAEMON_NAME running"
PID=$(get_pid $MOUNTD)
if [ -z "$PID" ]; then
stat_fail
else
stat_done
fi

if [ "$NEED_SVCGSSD" = yes ]; then
stat_busy "Daemon $SVCGSSD_DAEMON_NAME running"
PID=$(get_pid $SVCGSSD)
if [ -z "$PID" ]; then
stat_fail
else
stat_done
fi
fi
echo
;;

reload)
rc=0
stat_busy "Re-exporting all directories"
$EXPORTFS -r
rc=$(($rc+$?))
if [ $rc -gt 0 ]; then
stat_fail
exit $rc
else
stat_done
fi
;;

restart)
$0 stop
sleep 3
$0 start
;;
*)
echo "usage: $0 {start|stop|status|reload|restart}"
esac
exit 0')
Edit (5/13): Now ddclient has lost its rc.d scripts, so here are the old scripts.
/etc/rc.d/ddclient
$this->bbcode_second_pass_code('', '
#!/bin/bash

[ -f /etc/conf.d/ddclient ] && . /etc/conf.d/ddclient

. /etc/rc.conf
. /etc/rc.d/functions

PIDFILE=/var/run/ddclient.pid
PID=`cat $PIDFILE 2>/dev/null`

# Is ddclient running?

case "$1" in
start)
stat_busy "Starting ddclient"
[ -z "$PID" ] && /usr/sbin/ddclient ${EXTRA_ARGS}
if [ $? -gt 0 ]; then
stat_fail
else
add_daemon ddclient
stat_done
fi
;;
stop)
stat_busy "Stopping ddclient"
[ -n "$PID" ] && kill -15 $PID >/dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon ddclient
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac')
/etc/conf.d/ddclient
$this->bbcode_second_pass_code('', '
# Parameters passed to ddclient
EXTRA_ARGS="-daemon 300"')
Edit (5/13): Now exim has lost its rc.d scripts, so here are the old scripts.
/etc/rc.d/exim
$this->bbcode_second_pass_code('', '
#!/bin/bash

# source application-specific settings
[ -f /etc/conf.d/exim ] && . /etc/conf.d/exim

# general config
. /etc/rc.conf
. /etc/rc.d/functions

PID=`pidof -o %PPID /usr/bin/exim`

case "$1" in
start)
stat_busy "Starting Exim"
[ -z "$PID" ] && /usr/bin/exim $EXIM_ARGS
if [ $? -gt 0 ]; then
stat_fail
else
add_daemon exim
stat_done
fi
;;
stop)
stat_busy "Stopping Exim"
[ ! -z "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm /var/run/exim.pid
rm_daemon exim
stat_done
fi
;;
restart)
$0 stop
sleep 2
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0')
/etc/conf.d/exim
$this->bbcode_second_pass_code('', '
EXIM_ARGS="-bd -q15m"')
Edit (5/13): Now named has lost its rc.d scripts, so here are the old scripts.
/etc/rc.d/named
$this->bbcode_second_pass_code('', '
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/named

PIDFILE=/run/named/named.pid
PID=$(cat $PIDFILE 2>/dev/null)
readlink -q /proc/$PID/exe | grep -q '^/usr/bin/named' || { PID=; rm $PIDFILE 2>/dev/null; }

case "$1" in
start)
stat_busy "Starting BIND"
[ -z "$PID" ] && /usr/bin/named ${NAMED_ARGS}
if [ $? -gt 0 ]; then
stat_fail
else
add_daemon named
stat_done
fi
;;
stop)
stat_busy "Stopping BIND"
[ ! -z "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon named
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
reload)
stat_busy "Reloading BIND"
[ ! -z "$PID" ] && rndc reload &>/dev/null || kill -HUP $PID &>/dev/null
if [ $? -gt 0 ]; then
stat_fail
else
stat_done
fi
;;
*)
echo "usage: $0 {start|stop|reload|restart}"
esac
exit 0')
/etc/conf.d/named
$this->bbcode_second_pass_code('', '
#
# Parameters to be passed to BIND
#
NAMED_ARGS="-u named"')
Edit (5/13): Now rsyncd has lost its rc.d script, so here is the old script.
/etc/rc.d/rsyncd
$this->bbcode_second_pass_code('', '
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

[ -f /etc/conf.d/rsyncd ] && . /etc/conf.d/rsyncd

case "$1" in
start)
stat_busy "Starting rsyncd"
[ ! -f /run/daemons/rsyncd ] && /usr/bin/rsync --daemon $RSYNCD_ARGS
if [ $? -gt 0 ]; then
stat_fail
else
add_daemon rsyncd
stat_done
fi
;;
stop)
stat_busy "Stopping rsyncd"
[ -f /run/rsyncd.pid ] && kill `cat /run/rsyncd.pid`
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon rsyncd
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0')
Edit (5/15): Now distccd has lost its rc.d script, so here is the old script.
/etc/rc.d/distccd
$this->bbcode_second_pass_code('', '
#!/bin/bash

[ -f /etc/conf.d/distccd ] && . /etc/conf.d/distccd

. /etc/rc.conf
. /etc/rc.d/functions

PID=`pidof -o %PPID /usr/bin/distccd`
case "$1" in
start)
stat_busy "Starting distcc Daemon"
[ -z "$PID" ] && /usr/bin/distccd --daemon ${DISTCC_ARGS}
if [ $? -gt 0 ]; then
stat_fail
else
add_daemon distccd
stat_done
fi
;;
stop)
stat_busy "Stopping distcc Daemon"
[ ! -z "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon distccd
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0')
Edit (5/15): Now motion has lost its rc.d script, so here is the old script.
/etc/rc.d/motion
$this->bbcode_second_pass_code('', '
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

PID=`pidof -o %PPID /usr/bin/motion`
case "$1" in
start)
stat_busy "Starting Motion"
mkdir -p /var/run/motion
[ -z "$PID" ] && /usr/bin/motion 1>/dev/null 2>&1
if [ $? -gt 0 ]; then
stat_fail
else
add_daemon motion
stat_done
fi
;;
stop)
stat_busy "Stopping Motion"
[ ! -z "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon motion
stat_done
fi
;;
restart)
$0 stop
sleep 3
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0')
Edit (5/15): Now prosody has lost its rc.d script, so here is the old script.
/etc/rc.d/prosody
$this->bbcode_second_pass_code('', '
#!/bin/bash

daemon_name=prosody
pid_file=/var/run/$daemon_name/$daemon_name.pid

source /etc/rc.conf
source /etc/rc.d/functions

get_pid() {
if [ -f $pid_file ]; then
/bin/kill -0 $(cat $pid_file)
if [ $? == 0 ]; then
cat $pid_file
fi
fi
}

case "$1" in
start)
stat_busy "Starting $daemon_name daemon"

[ -d /var/run/$daemon_name ] || { mkdir -p /var/run/$daemon_name ; chown prosody:prosody /var/run/prosody; }
PID=$(get_pid)
if [ -z "$PID" ]; then
[ -f $pid_file ] && rm -f $pid_file
mkdir -p `dirname $pid_file`
prosodyctl start 1>/dev/null 2>/dev/null
if [ $? -gt 0 ]; then
stat_fail
exit 1
else
add_daemon $daemon_name
stat_done
fi
else
stat_fail
printhl "$daemon_name is already running"
exit 1
fi
;;

stop)
stat_busy "Stopping $daemon_name daemon"
PID=$(get_pid)
if [ ! -z "$PID" ]; then
prosodyctl stop 1>/dev/null 2>/dev/null
if [ $? -gt 0 ]; then
stat_fail
exit 1
else
rm -f $pid_file &> /dev/null
rm_daemon $daemon_name
stat_done
fi
else
stat_fail
printhl "$daemon_name is not running"
exit 1
fi
;;

restart)
$0 stop
$0 start
;;

reload)
stat_busy "Reloading $daemon_name"
PID=$(get_pid)
if [ ! -z "$PID" ]; then
/bin/kill -HUP $PID 2> /dev/null
if [ $? -gt 0 ]; then
stat_fail
exit 1
else
stat_done
fi
else
stat_fail
printhl "$daemon_name is not running"
fi
;;

status)
stat_busy "Checking $daemon_name status";
ck_status $daemon_name
;;

*)
echo "usage: $0 {start|stop|restart|reload|status}"
esac

exit 0')
Edit (5/15): Now dante has lost its rc.d script, so here is the old script.
/etc/rc.d/sockd
$this->bbcode_second_pass_code('', '
#!/bin/bash

daemon_name=sockd

. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/sockd.conf

get_pid() {
cat /var/run/sockd.pid 2>/dev/null
}

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 $SOCKD_OPTS 1>/dev/null 2>/dev/null
#
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
;;

status)
stat_busy "Checking $daemon_name status";
ck_status $daemon_name
;;

*)
echo "usage: $0 {start|stop|restart|status}"
esac

exit 0')
Edit (5/15): Now tor has lost its rc.d scripts, so here are the old scripts.
/etc/rc.d/tor
$this->bbcode_second_pass_code('', '
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

# source application-specific settings
[ -f /etc/conf.d/tor ] && . /etc/conf.d/tor

PID=`pidof -o %PPID /usr/bin/tor`
case "$1" in
start)
stat_busy "Starting Tor Daemon"
if [ -z "${TOR_MAX_FD}" ] || ulimit -n "${TOR_MAX_FD}"; then
[ -z "$PID" ] && /usr/bin/tor -f ${TOR_CONF} ${TOR_ARGS} &>/dev/null
if [ $? -gt 0 ]; then
stat_fail
else
add_daemon tor
stat_done
fi
else
stat_fail
fi
;;
stop)
stat_busy "Stopping Tor Daemon"
[ ! -z "$PID" ] && kill -INT $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon tor
stat_done
fi
;;
restart)
$0 stop
sleep 3
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0
# vim: ft=sh ts=2 sw=2')
/etc/conf.d/tor
$this->bbcode_second_pass_code('', '
# Location of the config file.
TOR_CONF='/etc/tor/torrc'

# Custom ulimit for maximum number of open files.
TOR_MAX_FD=

# Additional arguments.
TOR_ARGS="--quiet"
')
Edit (5/17): Now ftpd has lost its rc.d scripts, so here are the old scripts.
/etc/rc.d/ftpd
$this->bbcode_second_pass_code('', '
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/ftpd

PID=$(pidof -o %PPID /usr/bin/ftpd)
case "$1" in
start)
stat_busy "Starting ftpd"
[ -z "$PID" ] && /usr/bin/ftpd -D $FTPD_ARGS
if [ $? -gt 0 ]; then
stat_fail
else
add_daemon ftpd
stat_done
fi
;;
stop)
stat_busy "Stopping ftpd"
[ ! -z "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon ftpd
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0')
/etc/conf.d/ftpd
$this->bbcode_second_pass_code('', '
#
# Parameters to be passed to ftpd
#
FTPD_ARGS=""')
Also, MySQL has been mentioned here, warning that you shouldn't upgrade it to anything newer than 5.5.24-1 as newer versions are incompatible with this old kernel, and providing a link to version 5.5.24-1.

sethjvm, from your signature, I see you would like to install openvpn, a proxy server, nfs and lvm. I have found that OpenVPN works fine, privoxy works well with Tor, NFSv4 works ok, and LVM works if you load the "dm_mod" module.
Last edited by Geoff on Fri May 24, 2013 4:08 pm, edited 16 times in total.
Geoff
 
Posts: 231
Joined: Wed Mar 09, 2011 5:14 pm

Re: Which packages should not be updated?

Postby sethjvm » Fri Mar 01, 2013 10:09 pm

does anyone have a sickbeard script that they can post?
Pogo Plug Pro with ALARM SATA rootfs
success: wireless, samba, sabnzbd, sickbeard, transmission, lamp with Gallery3 and newznab+, rsync server, tor
still trying: avahi, minidlna
up next: asterisk, openvpn, proxy server of some sort
gave up: nfs and lvm
sethjvm
 
Posts: 53
Joined: Wed Oct 19, 2011 7:36 am

Re: Which packages should not be updated?

Postby Scarfish » Mon Mar 04, 2013 9:51 am

/etc/rc.d/sickbeard:
$this->bbcode_second_pass_code('', '#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/sickbeard

SB_PIDFILE="/run/sickbeard/sickbeard.pid"

case "$1" in
start)
stat_busy "Starting Sick Beard"

if [ -f /run/daemons/sickbeard ]; then
echo "Sick Beard is already running as a daemon! If you are certain it is not, remove /run/daemons/sickbeard."
stat_fail
elif [ -f $SB_PIDFILE ]; then
echo "Sick Beard may already be running. If you are certain it is not, remove $SB_PIDFILE."
stat_fail
else
SB_ARGS+=" --pidfile $SB_PIDFILE"
if [ ! "$SB_USER" ]; then
/usr/bin/env python2 /opt/sickbeard/SickBeard.py $SB_ARGS
RC=$?
else
su - $SB_USER -s /bin/sh -c "/usr/bin/env python2 /opt/sickbeard/SickBeard.py $SB_ARGS"
RC=$?
fi

if [ $RC -gt 0 ]; then
stat_fail
else
add_daemon sickbeard
stat_done
fi
fi
;;
stop)
stat_busy "Stopping Sick Beard"

if [ ! -f $SB_PIDFILE ]; then
echo "The pid file is missing. Check that Sick Beard is actually running."
RC=1
else
read -r SB_PID < $SB_PIDFILE
kill $SB_PID
RC=$?
fi

if [ $RC -gt 0 ]; then
echo "The shutdown failed. Check that Sick Beard is actually running."
stat_fail
else
while [ -f $SB_PIDFILE ]; do
sleep 1
done

rm_daemon sickbeard
stat_done
fi
;;
restart)
"$0" stop
sleep 1
"$0" start
;;
status)
stat_busy "Sick Beard daemon status:";
ck_status $daemon_name
;;

*)
echo "usage: $0 {start|stop|restart|status}"
esac
exit 0

')

/etc/conf.d/sickbeard:
$this->bbcode_second_pass_code('', '# Configuration parameters for the sickbeard daemon.

# User that Sick Beard will run as
# Leave blank to run as the current user (likely root).
# If you change the user, you must now modify the sickbeard tmpfiles config file.
# To do that, copy /usr/lib/tmpfiles.d/sickbeard.conf to /etc/tmpfiles.d/sickbeard.conf and modify the user in that file.
# You also need to change the datadir to somewhere writable by that user by adding it to the SB_ARGS, e.g. --datadir=/home/$USER/.sickbeard
SB_USER="sickbeard"

# Sick Beard arguments
SB_ARGS="--quiet --daemon --config /opt/sickbeard/config.ini"

')
Scarfish
 
Posts: 14
Joined: Fri Jan 20, 2012 3:02 pm

Re: Which packages should not be updated?

Postby sethjvm » Mon Mar 04, 2013 11:58 am

Merci beaucoup.
Pogo Plug Pro with ALARM SATA rootfs
success: wireless, samba, sabnzbd, sickbeard, transmission, lamp with Gallery3 and newznab+, rsync server, tor
still trying: avahi, minidlna
up next: asterisk, openvpn, proxy server of some sort
gave up: nfs and lvm
sethjvm
 
Posts: 53
Joined: Wed Oct 19, 2011 7:36 am

Re: Which packages should not be updated?

Postby James16 » Thu May 16, 2013 8:12 pm

Hello,

I'm looking for the minidlna script!!!
James16
 
Posts: 1
Joined: Thu May 16, 2013 8:11 pm

Re: Which packages should not be updated?

Postby Geoff » Thu May 23, 2013 6:41 am

Here are some more lost scripts:

/etc/rc.d/avahi-daemon:
$this->bbcode_second_pass_code('', '
#!/bin/bash

# This file is part of avahi.
#
# avahi is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# avahi is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with avahi; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.

#
# Authors: <lathiat@bur.st>
#


# general config
. /etc/rc.conf
. /etc/rc.d/functions

PATH=/sbin:/bin:/usr/sbin:/usr/bin
DESC="Avahi mDNS/DNS-SD Daemon"
NAME="avahi-daemon"
DAEMON="/usr/bin/$NAME"

case "$1" in
start)
ck_daemon dbus && { echo -n "Start dbus first." >&2; stat_die; }
stat_busy "Starting $DESC"
$DAEMON -D > /dev/null 2>&1
if [ $? -gt 0 ]; then
stat_fail
else
add_daemon $NAME
stat_done
fi
;;
stop)
stat_busy "Stopping $DESC"
$DAEMON -k > /dev/null 2>&1
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon $NAME
stat_done
fi
;;
restart)
$0 stop
$0 start
;;
reload)
stat_busy "Reloading services for $DESC"
$DAEMON -r > /dev/null 2>&1
if [ $? -gt 0 ]; then
stat_fail
else
stat_done
fi
;;
*)
echo "usage: $0 {start|stop|restart|reload}"
;;
esac
exit 0')
/etc/rc.d/avahi-dnsconfd:
$this->bbcode_second_pass_code('', '
#!/bin/bash

# This file is part of avahi.
#
# avahi is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# avahi is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with avahi; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.

#
# Authors: <lathiat@bur.st>
#


# general config
. /etc/rc.conf
. /etc/rc.d/functions

PATH=/sbin:/bin:/usr/sbin:/usr/bin
DESC="Avahi mDNS/DNS-SD DNS Server Configuration Daemon"
NAME="avahi-dnsconfd"
DAEMON="/usr/bin/$NAME"

case "$1" in
start)
stat_busy "Starting $DESC"
$DAEMON -D > /dev/null 2>&1
if [ $? -gt 0 ]; then
stat_fail
else
add_daemon $NAME
stat_done
fi
;;
stop)
stat_busy "Stopping $DESC"
$DAEMON -k > /dev/null 2>&1
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon $NAME
stat_done
fi
;;
restart)
$0 stop
$0 start
;;
reload)
stat_busy "Reloading services for $DESC"
$DAEMON -r > /dev/null 2>&1
if [ $? -gt 0 ]; then
stat_fail
else
stat_done
fi
;;
*)
echo "usage: $0 {start|stop|restart|reload}"
;;
esac
exit 0')
/etc/rc.d/crond:
$this->bbcode_second_pass_code('', '
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

name=crond
. /etc/conf.d/crond
PID=$(pidof -o %PPID /usr/bin/crond)

case "$1" in
start)
stat_busy "Starting $name daemon"
[[ -z "$PID" ]] && /usr/bin/crond $CRONDARGS &>/dev/null \
&& { add_daemon $name; stat_done; } \
|| { stat_fail; exit 1; }
;;
stop)
stat_busy "Stopping $name daemon"
[[ -n "$PID" ]] && kill $PID &>/dev/null \
&& { rm_daemon $name; stat_done; } \
|| { stat_fail; exit 1; }
;;
reload)
stat_busy "Reloading $name daemon"
[[ -n "$PID" ]] && kill -HUP $PID &>/dev/null \
&& { stat_done; } \
|| { stat_fail; exit 1; }
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart|reload}"
;;
esac
exit 0')
/etc/rc.d/krb5-kadmind:
$this->bbcode_second_pass_code('', '
#!/bin/bash

# general config
. /etc/rc.conf
. /etc/rc.d/functions

PID=`pidof -o %PPID /usr/bin/kadmind`
case "$1" in
start)
stat_busy "Starting Kerberos Admin Daemon"
if [ -z "$PID" ]; then
/usr/bin/kadmind
fi
if [ ! -z "$PID" -o $? -gt 0 ]; then
stat_fail
else
add_daemon krb5-kadmind
stat_done
fi
;;
stop)
stat_busy "Stopping Kerberos Admin Daemon"
[ ! -z "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon krb5-kadmind
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
;;
esac
exit 0')
/etc/rc.d/krb5-kdc:
$this->bbcode_second_pass_code('', '
#!/bin/bash

# general config
. /etc/rc.conf
. /etc/rc.d/functions

PID=`pidof -o %PPID /usr/bin/krb5kdc`
case "$1" in
start)
stat_busy "Starting Kerberos Authentication"
if [ -z "$PID" ]; then
/usr/bin/krb5kdc
fi
if [ ! -z "$PID" -o $? -gt 0 ]; then
stat_fail
else
add_daemon krb5-kdc
stat_done
fi
;;
stop)
stat_busy "Stopping Kerberos Authentication"
[ ! -z "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon krb5-kdc
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
;;
esac
exit 0')
/etc/rc.d/krb5-kpropd:
$this->bbcode_second_pass_code('', '
#!/bin/bash

# general config
. /etc/rc.conf
. /etc/rc.d/functions

PID=`pidof -o %PPID /usr/bin/kpropd`
case "$1" in
start)
stat_busy "Starting Kerberos Database Propagation Daemon"
if [ -z "$PID" ]; then
/usr/bin/kpropd -S
fi
if [ ! -z "$PID" -o $? -gt 0 ]; then
stat_fail
else
add_daemon kpropd
stat_done
fi
;;
stop)
stat_busy "Stopping Kerberos Database Propagation Daemon"
[ ! -z "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon kpropd
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
;;
esac
exit 0')
/etc/rc.d/mdadm:
$this->bbcode_second_pass_code('', '
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

pidfile=/run/mdadm.pid
if [[ -r $pidfile ]]; then
read -r PID <"$pidfile"
if [[ $PID && ! -d /proc/$PID ]]; then
# stale pidfile
unset PID
rm -f "$pidfile"
fi
fi

case $1 in
start)
stat_busy "Starting mdadm RAID Monitor"
if [[ -z $PID ]] && mdadm --monitor --scan -i "$pidfile" -f; then
add_daemon mdadm
stat_done
else
stat_fail
fi
;;
stop)
stat_busy "Stopping mdadm RAID Monitor"
if [[ $PID ]] && kill "$PID" &>/dev/null; then
rm_daemon mdadm
stat_done
else
stat_fail
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac')
/etc/rc.d/sshd:
$this->bbcode_second_pass_code('', '
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/sshd

PIDFILE=/run/sshd.pid
PID=$(cat $PIDFILE 2>/dev/null)
if ! readlink -q /proc/$PID/exe | grep -q '^/usr/bin/sshd'; then
PID=
rm $PIDFILE 2>/dev/null
fi

case "$1" in
start)
stat_busy 'Starting Secure Shell Daemon'
/usr/bin/ssh-keygen -A
[[ -z $PID ]] && /usr/bin/sshd $SSHD_ARGS
if [[ $? -gt 0 ]]; then
stat_fail
else
add_daemon sshd
stat_done
fi
;;
stop)
stat_busy 'Stopping Secure Shell Daemon'
[[ ! -z $PID ]] && kill $PID &> /dev/null
if [[ $? -gt 0 ]]; then
stat_fail
else
rm_daemon sshd
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0')
/etc/conf.d/sshd:
$this->bbcode_second_pass_code('', '
#
# Parameters to be passed to sshd
#
SSHD_ARGS=""')
Edit (5/24): Here are some more.

/etc/rc.d/openntpd:
$this->bbcode_second_pass_code('', '
#!/bin/bash

CONF=/etc/conf.d/openntpd

. /etc/rc.conf
. /etc/rc.d/functions
[[ -f $CONF ]] && . "$CONF"

PID=$(pidof -o %PPID /usr/bin/ntpd)
case $1 in
start)
stat_busy "Starting OpenNTPD"
[[ -d /run/openntpd ]] || mkdir /run/openntpd
if [[ $PID ]] || ! /usr/bin/ntpd $PARAMS; then
stat_fail
else
pidof -o %PPID /usr/bin/ntpd >/run/openntpd.pid
add_daemon openntpd
stat_done
fi
;;
stop)
stat_busy "Stopping OpenNTPD"
if [[ -z $PID ]] || ! kill $PID &>/dev/null; then
stat_fail
else
rm_daemon openntpd
stat_done
fi
;;
restart)
$0 stop
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0')
/etc/conf.d/openntpd:
$this->bbcode_second_pass_code('', '
# -s Set the time immediately at startup if the local clock is off by more than# 180 seconds.
PARAMS="-s"')
/etc/rc.d/xinetd:
$this->bbcode_second_pass_code('', '#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

PID=`pidof -o %PPID /usr/bin/xinetd`
case "$1" in
start)
stat_busy "Starting xinetd"
[ -z "$PID" ] && /usr/bin/xinetd -stayalive -pidfile /var/run/xinetd.pid
if [ $? -gt 0 ]; then
stat_fail
else
echo $PID > /var/run/xinetd.pid
add_daemon xinetd
stat_done
fi
;;
stop)
stat_busy "Stopping xinetd"
[ ! -z "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm -f /var/run/xinetd.pid
rm_daemon xinetd
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0')
Edit (6/3): Here are some more.

/etc/rc.d/ip6tables:
$this->bbcode_second_pass_code('', '
#!/bin/bash

# source application-specific settings
[ -f /etc/conf.d/iptables ] && . /etc/conf.d/iptables

# Set defaults if settings are missing
[ -z "$IP6TABLES_CONF" ] && IP6TABLES_CONF=/etc/iptables/ip6tables.rules

. /etc/rc.conf
. /etc/rc.d/functions

case "$1" in
start)
if [ ! -f "$IP6TABLES_CONF" ]; then
echo "Cannot load ip6tables rules: $IP6TABLES_CONF is missing!" >&2
exit 1
fi
stat_busy "Starting IP6 Tables"
if [ "$IPTABLES_FORWARD" = "1" ]; then
echo 1 >/proc/sys/net/ipv6/conf/default/forwarding
echo 1 >/proc/sys/net/ipv6/conf/all/forwarding
fi
if ck_daemon ip6tables; then
/usr/bin/ip6tables-restore < $IP6TABLES_CONF
if [ $? -gt 0 ]; then
stat_fail
else
add_daemon ip6tables
stat_done
fi
else
stat_fail
fi
;;
stop)
stat_busy "Stopping IP6 Tables"
if ! ck_daemon ip6tables; then
fail=0
for table in $(cat /proc/net/ip6_tables_names); do
/usr/bin/ip6tables-restore < /var/lib/iptables/empty-$table.rules
[ $? -gt 0 ] && fail=1
done
if [ $fail -gt 0 ]; then
stat_fail
else
rm_daemon ip6tables
stat_done
fi
else
stat_fail
fi
;;
restart)
$0 stop
$0 start
;;
save)
stat_busy "Saving IP6 Tables"
/usr/bin/ip6tables-save >$IP6TABLES_CONF
if [ $? -gt 0 ]; then
stat_fail
else
stat_done
fi
;;
*)
echo "usage: $0 {start|stop|restart|save}"
esac
exit 0')
/etc/rc.d/iptables:
$this->bbcode_second_pass_code('', '
#!/bin/bash

# source application-specific settings
[ -f /etc/conf.d/iptables ] && . /etc/conf.d/iptables

# Set defaults if settings are missing
[ -z "$IPTABLES_CONF" ] && IPTABLES_CONF=/etc/iptables/iptables.rules

. /etc/rc.conf
. /etc/rc.d/functions

case "$1" in
start)
if [ ! -f "$IPTABLES_CONF" ]; then
echo "Cannot load iptables rules: $IPTABLES_CONF is missing!" >&2
exit 1
fi
stat_busy "Starting IP Tables"
if [ "$IPTABLES_FORWARD" = "1" ]; then
echo 1 >/proc/sys/net/ipv4/ip_forward
fi
if ck_daemon iptables; then
/usr/bin/iptables-restore < $IPTABLES_CONF
if [ $? -gt 0 ]; then
stat_fail
else
add_daemon iptables
stat_done
fi
else
stat_fail
fi
;;
stop)
stat_busy "Stopping IP Tables"
if ! ck_daemon iptables; then
fail=0
for table in $(cat /proc/net/ip_tables_names); do
/usr/bin/iptables-restore < /var/lib/iptables/empty-$table.rules
[ $? -gt 0 ] && fail=1
done
if [ $fail -gt 0 ]; then
stat_fail
else
rm_daemon iptables
stat_done
fi
else
stat_fail
fi
;;
restart)
$0 stop
$0 start
;;
save)
stat_busy "Saving IP Tables"
/usr/bin/iptables-save >$IPTABLES_CONF
if [ $? -gt 0 ]; then
stat_fail
else
stat_done
fi
;;
*)
echo "usage: $0 {start|stop|restart|save}"
esac
exit 0')
/etc/conf.d/iptables:
$this->bbcode_second_pass_code('', '
# Configuration for iptables rules
IPTABLES_CONF=/etc/iptables/iptables.rules
IP6TABLES_CONF=/etc/iptables/ip6tables.rules

# Enable IP forwarding (both IPv4 and IPv6)
# NOTE: this is not the recommended way to do this, and is supported only for
# backward compatibility. Instead, use /etc/sysctl.conf and set the following
# options:
# * net.ipv4.ip_forward=1
# * net.ipv6.conf.default.forwarding=1
# * net.ipv6.conf.all.forwarding=1
#IPTABLES_FORWARD=0')
/etc/rc.d/privoxy:
$this->bbcode_second_pass_code('', '
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

# source application-specific settings
[ -f /etc/conf.d/privoxy ] && . /etc/conf.d/privoxy

# read logdir and logfile from privoxy config
prld=`grep ^logdir "$PRIVOXY_CONF" 2>/dev/null | cut -d' ' -f2`
[ -n "$prld" ] || prld=/var/log/privoxy
prlf=`grep ^logfile "$PRIVOXY_CONF" 2>/dev/null | cut -d' ' -f2`
[ -n "$prlf" ] || prlf=logfile

PID=`pidof -o %PPID /usr/bin/privoxy`

case "$1" in
start)
stat_busy "Starting Privoxy"
# create missing logdir and logfile
[ -d "$prld" ] || mkdir -p "$prld"
if [ ! -f "$prlf" ]; then
touch "$prld/$prlf" && chgrp "${PRIVOXY_GROUP}" "$prld/$prlf" && \
chmod 0660 "$prld/$prlf"
fi
[ -z "$PID" ] && /usr/bin/privoxy --user ${PRIVOXY_USER}.${PRIVOXY_GROUP} \
${PRIVOXY_ARGS} ${PRIVOXY_CONF}
if [ $? -gt 0 ]; then
stat_fail
else
add_daemon privoxy
stat_done
fi
;;
stop)
stat_busy "Stopping Privoxy"
[ ! -z "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon privoxy
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0')
/etc/conf.d/privoxy:
$this->bbcode_second_pass_code('', '
# Location of the config file.
PRIVOXY_CONF='/etc/privoxy/config'

# User and group that privoxy will be run as.
PRIVOXY_USER='privoxy'
PRIVOXY_GROUP='privoxy'

# Additional arguments.
PRIVOXY_ARGS="--pidfile /var/run/privoxy.pid"')
/etc/rc.d/rpcbind:
$this->bbcode_second_pass_code('', '
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

PID="$(pidof -o %PPID /usr/bin/rpcbind)"
case "$1" in
start)
stat_busy "Starting rpcbind"
[ -z "$PID" ] && /usr/bin/rpcbind &>/dev/null
if [ $? -gt 0 ]; then
stat_fail
else
PID=$(pidof -o %PPID /usr/bin/rpcbind)
echo $PID > /var/run/rpcbind.pid
add_daemon rpcbind
stat_done
fi
;;
stop)
stat_busy "Stopping rpcbind"
[ ! -z "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm /var/run/rpcbind.pid
rm_daemon rpcbind
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0')
Edit (6/4): Here are some more.

/etc/rc.d/dhcp4:
$this->bbcode_second_pass_code('', '
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/dhcp

PIDFILE="/var/run/dhcpd.pid"

if [[ -f $PIDFILE ]]; then
read -r PID < "$PIDFILE"

# prevent stale pidfiles from hanging around
if [[ ! -d /proc/$PID ]]; then
echo 'pid not found. deleteing stale pidfile'
unset PID
rm -f "$PIDFILE"
fi
fi

case "$1" in
start)
stat_busy "Starting DHCPv4 Server"
if [[ $PID ]]; then
stat_fail
exit 1
fi
if /usr/bin/dhcpd -4 -pf "$PIDFILE" $DHCP4_ARGS; then
add_daemon dhcp4
stat_done
else
stat_fail
exit 1
fi
;;
stop)
stat_busy "Stopping DHCPv4 Server"
if [[ ! $PID ]]; then
stat_fail
exit 1
fi
if { kill $PID && rm -f "$PIDFILE"; } &>/dev/null; then
rm_daemon dhcp4
stat_done
else
stat_fail
exit 1
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac')
/etc/rc.d/dhcp6:
$this->bbcode_second_pass_code('', '
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/dhcp

PIDFILE="/var/run/dhcp6.pid"

if [[ -f $PIDFILE ]]; then
read -r PID < "$PIDFILE"

# prevent stale pidfiles from hanging around
if [[ ! -d /proc/$PID ]]; then
echo 'pid not found. deleteing stale pidfile'
unset PID
rm -f "$PIDFILE"
fi
fi

case "$1" in
start)
stat_busy "Starting DHCPv6 Server"
if [[ $PID ]]; then
stat_fail
exit 1
fi
if /usr/bin/dhcpd -6 -pf "$PIDFILE" $DHCP6_ARGS; then
add_daemon dhcp6
stat_done
else
stat_fail
exit 1
fi
;;
stop)
stat_busy "Stopping DHCPv6 Server"
if [[ ! $PID ]]; then
stat_fail
exit 1
fi
if { kill $PID && rm -f "$PIDFILE"; } &>/dev/null; then
rm_daemon dhcp6
stat_done
else
stat_fail
exit 1
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac')
Edit (6/7): Here is another.

/etc/rc.d/ifplugd:
$this->bbcode_second_pass_code('', '
#!/bin/bash
#
# ifplugd daemon script for Arch Linux

. /etc/rc.conf
. /etc/rc.d/functions

shopt -s extglob

# env vars
daemonname=ifplugd
cfg=/etc/ifplugd/ifplugd.conf
PID=$(pidof -o %PPID ifplugd)

# source configuration file
[[ -r $cfg ]] && . "$cfg"

# discover interfaces to monitor
net_ifs=($INTERFACES)

case $1 in
start)
stat_busy "Starting $daemonname: ${net_ifs[*]}"

for nic in "${net_ifs[@]}"; do
# only start if a PID doesn't already exist
if [[ ! -f /var/run/ifplugd.$nic.pid ]]; then
/usr/bin/ifplugd-daemon $nic

# use presence of PID file to check for start success
[[ -f /var/run/ifplugd.$nic.pid ]] || (( ++err ))
fi
done
unset nic

if (( err )); then
stat_fail
exit 1
else
add_daemon $daemonname
stat_done
fi
;;
stop)
stat_busy "Stopping $daemonname: ${net_ifs[*]}"

for nic in /var/run/ifplugd.*.pid; do
[[ -f $nic ]] || { (( ++err )); break; }
nic=${nic%.pid}
nic=${nic##*.}
ifplugd -k -i "$nic" || (( ++err ))
done

if (( err )); then
stat_fail
exit 1
else
rm_daemon $daemonname
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
status)
for nic in "${net_ifs[@]}"; do
ifplugd -c -i "$nic"
done
unset nic
;;
suspend)
stat_busy "Suspending $daemonname: ${net_ifs[*]}"
for nic in "${net_ifs[@]}"; do
ifplugd -S -i $nic || (( ++err ))
done
unset nic

if (( err )); then
stat_fail
exit 1
else
stat_done
fi
;;
resume)
stat_busy "Resuming $daemonname ${net_ifs[*]}"

for nic in "${net_ifs[@]}"; do
ifplugd -R -i $nic || (( ++err ))
done
unset nic

if (( err )); then
stat_fail
exit 1
else
stat_done
fi
;;
*)
echo "usage: $0 {start|stop|restart|status|suspend|resume}"
esac
exit 0')
Edit (6/13): Here is another.

/etc/rc.d/ppp:
$this->bbcode_second_pass_code('', '#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

PID=`pidof -o %PPID /usr/sbin/pppd`
case "$1" in
start)
stat_busy "Starting PPP daemon"
[ -z "$PID" ] && /usr/bin/pon
if [ $? -gt 0 ]; then
stat_fail
else
add_daemon ppp
stat_done
fi
;;
stop)
stat_busy "Stopping PPP daemon"
[ ! -z "$PID" ] && poff -a &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon ppp
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0')
Edit (6/21): Here's one I didn't notice before.

/etc/rc.d/nscd:
$this->bbcode_second_pass_code('', '#!/bin/bash

daemon_name="nscd"

. /etc/rc.conf
. /etc/rc.d/functions


get_pid() {
pidof -o %PPID $daemon_name
}

case "$1" in
start)
stat_busy "Starting $daemon_name daemon"
PID=$(get_pid)
if [[ -z $PID ]]; then
rm -f /run/$daemon_name.pid
mkdir -p /run/nscd /var/db/nscd
rm -f /run/nscd/* /var/db/nscd/*
$daemon_name
if (( $? > 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)
[[ -n $PID ]] && nscd --shutdown &> /dev/null
if (( $? > 0 )); then
stat_fail
exit 1
else
rm -f /run/$daemon_name.pid &> /dev/null
rm_daemon $daemon_name
stat_done
fi
;;

restart)
$0 stop
sleep 3
$0 start
;;

status)
stat_busy "Checking $daemon_name status";
ck_status $daemon_name
;;

*)
echo "usage: $0 {start|stop|restart|status}"
esac

exit 0')
Last edited by Geoff on Sat Jun 22, 2013 4:28 am, edited 6 times in total.
Geoff
 
Posts: 231
Joined: Wed Mar 09, 2011 5:14 pm

Next

Return to Community Supported

Who is online

Users browsing this forum: No registered users and 24 guests