Moved to slp format, also removed sysvinit dependency (unsure why it was there)

This commit is contained in:
2020-08-23 08:20:52 -05:00
parent b9d20d9c88
commit 92980232a6
5 changed files with 7 additions and 7 deletions

5
SL/README Normal file
View File

@@ -0,0 +1,5 @@
This is the directory where the manifest, snapinfo,
and files.tar.gz files will be created. It is also
where the usher file should be placed if it is
required by the package. Any other files that need
to be included could also be placed here.

47
SL/cron.init Executable file
View File

@@ -0,0 +1,47 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: cron
# Required-Start: $remote_fs $syslog $time
# Required-Stop: $remote_fs $syslog $time
# Should-Start: $network $named slapd autofs ypbind nscd nslcd
# Should-Stop: $network $named slapd autofs ypbind nscd nslcd
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Regular background program processing daemon
# Description: cron is a standard UNIX program that runs user-specified
# programs at periodic scheduled times. vixie cron adds a
# number of features to the basic UNIX cron, including better
# security and more powerful configuration options.
### END INIT INFO
DAEMON=/sbin/cron
PIDFILE=/var/run/cron.pid
. /lib/lsb/init-functions
[ -r /etc/default/cron ] && . /etc/default/cron
case "$1" in
start)
log_init_msg "Starting cron"
start_daemon -p "$PIDFILE" "$DAEMON" "$CRONARGS" && log_success_msg || \
log_failure_msg
;;
stop)
log_init_msg "Stopping cron"
killproc -p "$PIDFILE" "$DAEMON" && log_success_msg || log_failure_msg
;;
restart)
$0 stop
sleep 1
$0 start
;;
status)
status_of_proc -p "$PIDFILE" "$DAEMON" || exit 1
;;
*)
echo "Usage: $0 [start|stop|restart|status]"
exit 1
;;
esac
exit 0

39
SL/runall Executable file
View File

@@ -0,0 +1,39 @@
#!/bin/sh
usage () {
echo "Usage: ${0#*/} [DIRECTORY]..."
echo "Run all executable scripts in one or more directories"
exit $1
}
ERRORS=
if [ -z "$1" ]; then
usage 2
fi
for dir in "$@"; do
dir=${dir%/}
if [ ! -d "$dir" ]; then
echo "$dir: invalid directory"
usage 2
fi
for file in "$dir"/*; do
if [ -x "$file" ]; then
"$file"
if [ "$?" -gt 0 ]; then
ERRORS="$ERRORS $file"
fi
fi
done
done
if [ -n "$ERRORS" ]; then
echo "There were errors in the following scripts:$ERRORS"
exit 1
fi

20
SL/usher Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/sh
set -e
case $1 in
preinst)
exit 0
;;
postinst)
/etc/init.d/cron status 2>&1 > /dev/null && /etc/init.d/cron restart
exit 0
;;
prerm)
/etc/init.d/cron status 2>&1 > /dev/null && /etc/init.d/cron stop
exit 0
;;
postrm)
exit 0
;;
esac