Mailinglist Archive: opensuse-bugs (6192 mails)

< Previous Next >
[Bug 623766] New: startproc/checkproc/killproc do not work with scripts
  • From: bugzilla_noreply@xxxxxxxxxx
  • Date: Tue, 20 Jul 2010 06:47:56 +0000
  • Message-id: <bug-623766-21960@xxxxxxxxxxxxxxxxxxxxxxxx/>
http://bugzilla.novell.com/show_bug.cgi?id=623766

http://bugzilla.novell.com/show_bug.cgi?id=623766#c0


Summary: startproc/checkproc/killproc do not work with scripts
Classification: openSUSE
Product: openSUSE 11.2
Version: Final
Platform: x86-64
OS/Version: openSUSE 11.2
Status: NEW
Severity: Major
Priority: P5 - None
Component: Basesystem
AssignedTo: bnc-team-screening@xxxxxxxxxxxxxxxxxxxxxx
ReportedBy: Uwe.Girlich@xxxxxxxxxxx
QAContact: qa@xxxxxxx
Found By: ---
Blocker: ---


User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR
1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648;
NET CLR 3.5.21022; InfoPath.2)

A /etc/init.d script is using startproc/checkproc/killproc to handle a python
script as a daemon. With openSUSE 10.2 this script works fine. After updating
to 11.2 it does not work anymore correct. We can start the daemon, but no
restarts or stops are possible with these tools. We find out that the binaries
above do not work in the same matter as in 10.2.
The man page said startproc can not handle scripts, but why it works in 10.2?


Reproducible: Always

Steps to Reproduce:
1. Creating a start/stop script in /etc/init.d using
startproc/checkproc/killproc
2. The script calls a python script which runs as daemon
3. Try the functionality with this daemon
Actual Results:
- restart startproc with the same script returns an error from the script, but
startproc must not start the script again.
- checkproc could not found the running script, returns 3 (No process and no
pid file found)
- killproc do not kill the running script and returns 7 (program was not
running)


Expected Results:
- restarting the process should return 0 and do nothing more
- checkproc should return 0 (process is running)
- killproc finish the process and returns 0

Analyzing startproc and friend with strace I found this difference between 10.2
and 11.:

10.2 (32-bit)
open("/proc/5492/cmdline", O_RDONLY|O_LARGEFILE) = 4
read(4, "/usr/bin/python\0/usr/local/bin/xxx.py\0", 255) = 54
close(4)

11.2 (64-bit)
openat(3, "4809/cmd", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file
or directory)

No one file /proc/[pid]/cmd does exist on the system, neither in 10.2 nor in
11.2. But files /proc/[pid]/cmdline are existing in both systems.

When I changed "cmd" to "cmdline" in source of 11. of libinit.c and compile it
the commands are working as well as in 10.2.

Do not trust the man page of startproc, see the source code of these tools .
They can handle scripts. So the man page should also be updated.

rpm -q -f /sbin/startproc -> sysvinit-2.86-215.2.x86_64
for 10.2: sysvinit-2.86-47

--
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

< Previous Next >