Bug 4491 - status of vsmserver/vsmagent init.d script only works correct if executed as root.
Summary: status of vsmserver/vsmagent init.d script only works correct if executed as ...
Status: CLOSED DUPLICATE of bug 1443
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: VSM Server (show other bugs)
Version: 3.4.0
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.1.0
Assignee: Peter Åstrand
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-26 14:14 CET by Henrik Andersson
Modified: 2012-11-28 09:41 CET (History)
0 users

See Also:
Acceptance Criteria:


Attachments

Description Henrik Andersson cendio 2012-11-26 14:14:45 CET
$ service vsmserver status
ThinLinc vsmserver is stopped
$ sudo service vsmserver status
[sudo] password for cendio: 
ThinLinc vsmserver (pid 1188) is running
Comment 1 Henrik Andersson cendio 2012-11-26 14:18:19 CET
We could source /lib/lsb/init-functions as the other init script does
and provided init helper functions like:

status_of_proc -p /var/run/sshd.pid /usr/sbin/sshd sshd && exit 0 || exit $?

which in it ends does:

if $(kill -0 "${pid:-}" 2> /dev/null); then
  echo "$pid"
  return 0
elif ps "${pid:-}" >/dev/null 2>&1; then
  echo "$pid"
  return 0 # program is running, but not owned by this user
else
  return 1 # program is dead and /var/run pid file exists
fi


Comparing this to our own, we just fail if kill -0  failes, which
will always fail for non root users in our case and give the false
status.
Comment 2 Henrik Andersson cendio 2012-11-26 14:40:08 CET

*** This bug has been marked as a duplicate of bug 1443 ***

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