Bug 893129 - condrestart mode fails in init script /etc/rc.d/init.d/shellinaboxd
Summary: condrestart mode fails in init script /etc/rc.d/init.d/shellinaboxd
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: shellinabox
Version: el5
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Simone Caronni
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-01-08 16:37 UTC by Gilles Detillieux
Modified: 2013-02-01 13:20 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-01-23 16:04:04 UTC
Type: Bug


Attachments (Terms of Use)
simple fix to init script, changing restart call into stop and start calls (319 bytes, patch)
2013-01-08 16:37 UTC, Gilles Detillieux
no flags Details | Diff

Description Gilles Detillieux 2013-01-08 16:37:53 UTC
Created attachment 674950 [details]
simple fix to init script, changing restart call into stop and start calls

Description of problem:
When running "service shellinaboxd condrestart" on RHEL 5.x, using the latest EPEL package of shellinabox (2.14-17.git88822c1f.el5), I get an error and the running process is not restarted.

Version-Release number of selected component (if applicable):
2.14-17.git88822c1f.el5

How reproducible:
Always

Steps to Reproduce:
1. Install shellinabox-2.14-17.git88822c1f.el5.i386.rpm
2. Make sure process is running, e.g. service shellinabox restart
3. Run "service shellinabox condrestart"
  
Actual results:
/etc/init.d/shellinaboxd: line 68: restart: command not found

Expected results:
Shutting down shellinaboxd:                                [  OK  ]
Starting shellinaboxd:                                     [  OK  ]


Additional info:
When running in "restart" mode, the script calls the "stop" function, then the "start" function, to restart the process.  But when running the "condrestart" mode, after running rh_status_q to check if the process is running, it tries to run the "restart" function, which is not defined.  A few possible fixes would be:

1) change the "restart" to "stop" and then "start", as for the restart case
2) define the restart function, which would call stop and start functions
3) prepend "$0 " to the "restart" function call, so the script calls itself recursively in restart mode to do the restart

Comment 1 Simone Caronni 2013-01-09 10:57:27 UTC
Hello,

I've update the whole SysV init script according to the package guidelines; it should fix your problem.

At the time I became package mantainer I did not know about the packaging guidelines for the SysV init scripts.

https://fedoraproject.org/wiki/Packaging:SysVInitScript?rd=Packaging/SysVInitScript

http://pkgs.fedoraproject.org/cgit/shellinabox.git/commit/?id=1c82ff78a930e6023d323675ac15339aa72e0b51

Build is on the way.

Thanks,
--Simone

Comment 2 Fedora Update System 2013-01-09 12:06:08 UTC
shellinabox-2.14-18.git88822c1f.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/shellinabox-2.14-18.git88822c1f.fc17

Comment 3 Fedora Update System 2013-01-09 12:06:32 UTC
shellinabox-2.14-18.git88822c1f.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/shellinabox-2.14-18.git88822c1f.fc18

Comment 4 Fedora Update System 2013-01-09 12:06:59 UTC
shellinabox-2.14-18.git88822c1f.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/shellinabox-2.14-18.git88822c1f.fc16

Comment 5 Fedora Update System 2013-01-09 12:08:50 UTC
shellinabox-2.14-18.git88822c1f.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/shellinabox-2.14-18.git88822c1f.el6

Comment 6 Fedora Update System 2013-01-09 12:09:24 UTC
shellinabox-2.14-18.git88822c1f.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/shellinabox-2.14-18.git88822c1f.el5

Comment 7 Gilles Detillieux 2013-01-09 15:51:36 UTC
Oops, looks like you followed the template for the init script a little too literally.  The new stop() function just has the comment for the killproc command, but no actual command to kill the process, if I'm reading the diff listing on http://pkgs.fedoraproject.org/cgit/shellinabox.git/commit/?id=1c82ff78a930e6023d323675ac15339aa72e0b51 correctly.  Be sure to test this script!

Comment 8 Simone Caronni 2013-01-09 16:03:04 UTC
Argh, thanks, it's the second time it happens to me today:

http://pkgs.fedoraproject.org/cgit/bacula.git/commit/?id=298780eb5f44a8e1fed6a9e3a58acc779490ef03

Thanks!!!

Comment 9 Simone Caronni 2013-01-09 16:12:31 UTC
I'm rebuilding them all, in fact I spotted the mistake on my boxes but forgot to commit it.

Comment 10 Fedora Update System 2013-01-10 09:42:12 UTC
shellinabox-2.14-19.git88822c1f.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/shellinabox-2.14-19.git88822c1f.fc18

Comment 11 Fedora Update System 2013-01-10 09:42:34 UTC
shellinabox-2.14-19.git88822c1f.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/shellinabox-2.14-19.git88822c1f.fc17

Comment 12 Fedora Update System 2013-01-10 09:42:53 UTC
shellinabox-2.14-19.git88822c1f.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/shellinabox-2.14-19.git88822c1f.fc16

Comment 13 Fedora Update System 2013-01-10 09:43:12 UTC
shellinabox-2.14-19.git88822c1f.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/shellinabox-2.14-19.git88822c1f.el6

Comment 14 Fedora Update System 2013-01-10 09:43:33 UTC
shellinabox-2.14-19.git88822c1f.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/shellinabox-2.14-19.git88822c1f.el5

Comment 15 Fedora Update System 2013-01-10 21:27:57 UTC
Package shellinabox-2.14-19.git88822c1f.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing shellinabox-2.14-19.git88822c1f.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-0564/shellinabox-2.14-19.git88822c1f.fc18
then log in and leave karma (feedback).

Comment 16 Fedora Update System 2013-01-14 09:56:36 UTC
shellinabox-2.14-20.git88822c1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/shellinabox-2.14-20.git88822c1.fc18

Comment 17 Fedora Update System 2013-01-14 09:56:55 UTC
shellinabox-2.14-20.git88822c1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/shellinabox-2.14-20.git88822c1.fc17

Comment 18 Fedora Update System 2013-01-14 09:57:11 UTC
shellinabox-2.14-20.git88822c1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/shellinabox-2.14-20.git88822c1.fc16

Comment 19 Fedora Update System 2013-01-14 09:57:26 UTC
shellinabox-2.14-20.git88822c1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/shellinabox-2.14-20.git88822c1.el6

Comment 20 Fedora Update System 2013-01-14 09:57:44 UTC
shellinabox-2.14-20.git88822c1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/shellinabox-2.14-20.git88822c1.el5

Comment 21 Fedora Update System 2013-01-23 16:04:08 UTC
shellinabox-2.14-20.git88822c1.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 22 Fedora Update System 2013-01-23 16:24:20 UTC
shellinabox-2.14-20.git88822c1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 23 Fedora Update System 2013-01-23 16:29:27 UTC
shellinabox-2.14-20.git88822c1.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 24 Fedora Update System 2013-02-01 13:18:11 UTC
shellinabox-2.14-20.git88822c1.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 25 Fedora Update System 2013-02-01 13:20:47 UTC
shellinabox-2.14-20.git88822c1.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.


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