Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error on comparing sleep and 'last' while stopping #50

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bitterfox
Copy link

@bitterfox bitterfox commented Feb 14, 2020

$ sudo /sbin/service supervisord restart
Stopping supervisord: Shut down
Waiting roughly 60 seconds for /var/run/supervisord.pid to be removed after child processes exit
/etc/init.d/supervisord: line 61: last: unbound variable

-eq is comparing both as number, so "last" is considered as avariable name and then try to expand the value of the variable "last".
Should be =

    # always remove the subsys.  we might have waited a while, but just remove it at this point.
    rm -f /var/lock/subsys/supervisord

So this logic is not reached and lock file is remaining as a result.

$ ls -lah /var/lock/subsys/supervisord
-rw-r--r-- 1 root root 0 Feb 14 13:21 /var/lock/subsys/supervisord
$ ps aux | grep supervisor
user   4546  0.0  0.0 103316   912 pts/0    S+   13:27   0:00 grep supervisor
$ sudo /sbin/service supervisord status
unix:///var/run/supervisor.sock no such file
supervisord dead but subsys locked

Here is my environment I tested

$ cat /etc/redhat-release 
CentOS release 6.10 (Final)
$ uname -r
2.6.32-754.6.3.el6.x86_64
$ bash --version
GNU bash, version 4.1.2(2)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ /sbin/service --version
service ver. 0.91
$ supervisord -v
3.3.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant