How can I pass a command-line argument to the atd daemon which will persist across reboots and package upgrades? I wish to add the command line flag -l 7.5
to atd because I have an 8-CPU server and don't want to wait for the load level to go below the compiled-in value of 1.5 before running batch jobs.
(A similar question has been answered here, but that answer is not valid for Ubuntu 16.04 because the file /etc/init.d/atd.conf does not exist, and there is no line "exec atd" in my /etc/init.d/atd file.)
Unlike most of the scripts in /etc/init.d/, there is no corresponding atd file in /etc/defaults/ so I can't make any edits in there.
Here is the /etc/init.d/atd script:
#! /bin/sh
### BEGIN INIT INFO
# Provides: atd
# Required-Start: $syslog $time $remote_fs
# Required-Stop: $syslog $time $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Deferred execution scheduler
# Description: Debian init script for the atd deferred executions
# scheduler
### END INIT INFO
#
# Author: Ryan Murray <[email protected]>
#
PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/sbin/atd
PIDFILE=/var/run/atd.pid
test -x $DAEMON || exit 0
. /lib/lsb/init-functions
case "$1" in
start)
log_daemon_msg "Starting deferred execution scheduler" "atd"
start_daemon -p $PIDFILE $DAEMON
log_end_msg $?
;;
stop)
log_daemon_msg "Stopping deferred execution scheduler" "atd"
killproc -p $PIDFILE $DAEMON
log_end_msg $?
;;
force-reload|restart)
$0 stop
$0 start
;;
status)
status_of_proc -p $PIDFILE $DAEMON atd && exit 0 || exit $?
;;
*)
echo "Usage: /etc/init.d/atd {start|stop|restart|force-reload|status}"
exit 1
;;
esac
exit 0
I have tried adding -l 7.5 to the end of the start_daemon line in the start) section but that didn't make any difference (I still have a job in my queue although my load level is below 7.5; and ps -ef | grep atd | grep -v grep
yields daemon 23192 1 0 07:57 ? 00:00:00 /usr/sbin/atd -f
)