Package: ganglia-monitor
Version: 3.6.0-7+b2
Severity: important
Tags: patch

  Hi,

  After a long debug session, I realized that an administrator
cannot invoke directly the /etc/init.d/ganglia-monitor if he wants
systemd to be aware of the action.
  For example, gmond was started at boot, but it hungs due to the
reboot of the target machine (probably another bug).
  An admin types:
/etc/init.d/ganglia-monitor restart
  And then gmond have been restarted but systemd thinks the service is down.

Here is a trace illustrating what I say:

root@ge91097-vm1:/etc/ganglia# systemctl status ganglia-monitor
● ganglia-monitor.service
   Loaded: loaded (/etc/init.d/ganglia-monitor; generated)
  Drop-In: /etc/systemd/system/ganglia-monitor.service.d
           └─restart.conf
   Active: active (running) since Wed 2021-01-06 21:29:29 CET; 13s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 7134 ExecStart=/etc/init.d/ganglia-monitor start (code=exited, 
status=0/SUCCESS)
 Main PID: 7138 (gmond)
    Tasks: 2 (limit: 4915)
   Memory: 1.8M
   CGroup: /system.slice/ganglia-monitor.service
           └─7138 /usr/sbin/gmond --pid-file /var/run/gmond.pid

janv. 06 21:29:29 ge91097-vm1 systemd[1]: ganglia-monitor.service: Scheduled 
restart job, restart counter is at 1.
janv. 06 21:29:29 ge91097-vm1 systemd[1]: Stopped ganglia-monitor.service.
janv. 06 21:29:29 ge91097-vm1 systemd[1]: Starting ganglia-monitor.service...
janv. 06 21:29:29 ge91097-vm1 ganglia-monitor[7134]: Starting Ganglia Monitor 
Daemon: gmond.
janv. 06 21:29:29 ge91097-vm1 systemd[1]: Started ganglia-monitor.service.
root@ge91097-vm1:/etc/ganglia# systemd-cgls -u  ganglia-monitor.service
Unit ganglia-monitor.service (/system.slice/ganglia-monitor.service):
└─7138 /usr/sbin/gmond --pid-file /var/run/gmond.pid
root@ge91097-vm1:/etc/ganglia# ps axf | grep gmon
 7171 pts/0    S+     0:00  |                       \_ grep gmon
 7138 ?        Ssl    0:00 /usr/sbin/gmond --pid-file /var/run/gmond.pid
root@ge91097-vm1:/etc/ganglia# /etc/init.d/ganglia-monitor restart
Stopping Ganglia Monitor Daemon: gmond.
Starting Ganglia Monitor Daemon: gmond.
root@ge91097-vm1:/etc/ganglia# systemctl status ganglia-monitor
● ganglia-monitor.service
   Loaded: loaded (/etc/init.d/ganglia-monitor; generated)
  Drop-In: /etc/systemd/system/ganglia-monitor.service.d
           └─restart.conf
   Active: activating (auto-restart) since Wed 2021-01-06 21:30:20 CET; 5s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 7134 ExecStart=/etc/init.d/ganglia-monitor start (code=exited, 
status=0/SUCCESS)
  Process: 7176 ExecStop=/etc/init.d/ganglia-monitor stop (code=exited, 
status=0/SUCCESS)
 Main PID: 7138 (code=killed, signal=TERM)
root@ge91097-vm1:/etc/ganglia# systemd-cgls -u  ganglia-monitor.service
Unit ganglia-monitor.service not found.
Failed to list cgroup tree: No such file or directory
root@ge91097-vm1:/etc/ganglia# ps axf | grep gmon
 7189 pts/0    S+     0:00  |                       \_ grep gmon
 7179 ?        Ssl    0:00 /usr/sbin/gmond --pid-file /var/run/gmond.pid

gmond restarted, but systemd is unaware of it.



  The fix is pretty simple: as (nearly all) other init script,
just add the following line at the begining (just after LSB header):
. /lib/lsb/init-functions
It will handle the synchronization with systemd (or other
init systems) for direct script invocation.

  Regards
    Vincent

-- System Information:
Debian Release: bullseye/sid
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'oldstable-updates'), (500, 
'unstable'), (500, 'testing'), (500, 'stable'), (500, 'oldstable'), (1, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, armel, mipsel

Kernel: Linux 5.9.0-5-amd64 (SMP w/4 CPU threads)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages ganglia-monitor depends on:
ii  adduser              3.118
ii  init-system-helpers  1.60
ii  libapr1              1.7.0-4
ii  libc6                2.31-6
pn  libconfuse1          <none>
pn  libconfuse2          <none>
ii  libexpat1            2.2.10-1
pn  libganglia1          <none>
ii  libpcre3             2:8.39-13
ii  lsb-base             11.1.0
ii  zlib1g               1:1.2.11.dfsg-2

ganglia-monitor recommends no packages.

ganglia-monitor suggests no packages.

Reply via email to