Bug 1443 - Init scripts returns incorrect status for ordinary users
Summary: Init scripts returns incorrect status for ordinary users
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: VSM Agent (show other bugs)
Version: 1.4.0
Hardware: PC Linux
: P2 Normal
Target Milestone: 4.1.1
Assignee: Pierre Ossman
URL:
Keywords: hean01_tester, prosaic
: 4491 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-08-15 15:44 CEST by Peter Åstrand
Modified: 2013-10-24 10:46 CEST (History)
2 users (show)

See Also:
Acceptance Criteria:


Attachments

Description Peter Åstrand cendio 2005-08-15 15:44:13 CEST
When running "/etc/init.d/vsmagent status" as an ordinary user, the status is
incorrectly reported. The same goes for vsmserver. This is due to this code:

if kill -0 ${pid} 2>/dev/null; then
Comment 1 Peter Åstrand cendio 2005-08-15 16:38:09 CEST
I cannot find any obvious solution to this bug. Not important enough for 1.4.1,
retargeting. 
Comment 2 Henrik Andersson cendio 2012-11-26 14:40:08 CET
*** Bug 4491 has been marked as a duplicate of this bug. ***
Comment 3 Pierre Ossman cendio 2012-12-07 10:17:57 CET
Instead of kill -0 we could check for /proc/${pid} instead.
Comment 4 Pierre Ossman cendio 2013-08-14 14:00:01 CEST
Fixed in r27778.
Comment 5 Samuel Mannehed cendio 2013-10-14 12:29:41 CEST
Tested:

[samuel@justina-60 ctc]$ /etc/init.d/vsmagent status
vsmagent.service - LSB: Start or stop the ThinLinc vsmagent
   Loaded: loaded (/etc/rc.d/init.d/vsmagent)
   Active: active (running) since Mon 2013-10-14 12:26:43 CEST; 8s ago
  Process: 12096 ExecStop=/etc/rc.d/init.d/vsmagent stop (code=exited, status=0/SUCCESS)
  Process: 12124 ExecStart=/etc/rc.d/init.d/vsmagent start (code=exited, status=0/SUCCESS)
   CGroup: name=systemd:/system/vsmagent.service
           └─12144 python-thinlinc /opt/thinlinc/sbin/vsmagent

[samuel@justina-60 ctc]$ sudo service vsmagent stop
Shutting down ThinLinc vsmagent (via systemctl)
[samuel@justina-60 ctc]$ /etc/init.d/vsmagent status
vsmagent.service - LSB: Start or stop the ThinLinc vsmagent
   Loaded: loaded (/etc/rc.d/init.d/vsmagent)
   Active: inactive (dead) since Mon 2013-10-14 12:26:57 CEST; 1s ago
  Process: 12169 ExecStop=/etc/rc.d/init.d/vsmagent stop (code=exited, status=0/SUCCESS)
  Process: 12124 ExecStart=/etc/rc.d/init.d/vsmagent start (code=exited, status=0/SUCCESS)

Works as intended.
Comment 6 Samuel Mannehed cendio 2013-10-14 14:53:57 CEST
Pierre noted that this should be tested on a dist without systemd, Ubuntu for example.
Comment 7 Peter Åstrand cendio 2013-10-15 09:00:32 CEST
(In reply to comment #4)
> Fixed in r27778.

This commit fixes vsmagent and vsmserver, but we have tlwebaccess and tlwebadm as well.
Comment 8 Pierre Ossman cendio 2013-10-15 13:14:53 CEST
(In reply to comment #7)
> (In reply to comment #4)
> > Fixed in r27778.
> 
> This commit fixes vsmagent and vsmserver, but we have tlwebaccess and tlwebadm
> as well.

r28037.
Comment 9 Henrik Andersson cendio 2013-10-17 08:32:03 CEST
Verified with build 4110 that '/etc/init.d/tlwebaccess status' reported that the service is not running.

Upgrade to build 4116 which includes the fixes and verified that both tlwebaccess and tlwebadm reported status sucessfully.

Note You need to log in before you can comment on or make changes to this bug.