[MBT] new ticket for pkg at "Parameter handling in /etc/rc.d/init.d/atd (follow up)"

bugs at pld.org.pl bugs at pld.org.pl
Tue Jan 7 15:56:26 CET 2003


Date: 2003-01-07 15:56:26+01	Author:  (kreutzm) <kreutzm at itp.uni-hannover.de> 
Title:         Parameter handling in /etc/rc.d/init.d/atd (follow up)
Ticket ID:     #521
Ticket URL:    http://bugs.pld.org.pl/?bug=521
Package:       at-3.1.8-26
Distribution:  PLD-Ra.main
Category:      doesn't work as it should
Current state: opened
Text:

I don't know the CVS fix of my previous bug report against at, so this might have been partially fixed already, sorry for the confusion.

When /etc/sysconfig/atd is sourced in /etc/rc.d/init.d/atd, nothing is changed. Furthermore the suggested variable name in /etc/sysconfig/atd is dangerous since it is handled specially in /etc/rc.d/init.d/functions (atd internally looks at the nice level to determine when a job should be started, this has nothing to do with the nice level atd itself should be started).

The following patch does the following:
*Supply all sensible configurable values with harmless   variable names in /etc/sysconfig/atd
*Actually parse those name in /etc/rc.d/init.d/atd and start atd accordingly

TODO:
On SMP-Systems, the default value for SERVICE_INTERN_NICE_LEVEL
should be #CPU-1+0.8
Would it be possible to update /etc/sysconfig/atd at install time depending on the number of CPUs ?


Here come the patches:
*/etc/sysconfig/atd should look like this
# Customized setings for at

# Nice level required for at to start new jobs
#SERVICE_INTERN_NICE_LEVEL="0.8"

# minimum interval in seconds between the start of two batch jobs
#SERVICE_RUN_MIN_CHECK="60"


--- atd.orig    Fri Dec 20 17:16:23 2002
+++ atd Tue Jan  7 15:40:25 2003
@@ -17,6 +17,15 @@
 # Get service config
 [ -f /etc/sysconfig/atd ] && . /etc/sysconfig/atd
 
+# Assemble command line
+if [ "$SERVICE_INTERN_NICE_LEVEL" ]; then
+  ATSTRING="-l $SERVICE_INTERN_NICE_LEVEL"
+fi
+
+if [ "$SERVICE_RUN_MIN_CHECK" ]; then
+  ATSTRING="$ATSTRING -b $SERVICE_RUN_MIN_CHECK"
+fi
+
 
 # See how we were called.
 case "" in
@@ -24,7 +33,12 @@
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/atd ]; then
                msg_starting at
-               daemon atd
+                if [ "$ATSTRING" ]; then
+                       daemon atd $ATSTRING
+               else
+                       daemon atd
+                fi
+
        else
                msg_already_running atd
                exit 1




More information about the pld-bugs mailing list