Bug #1289
Improve centos init scripts
Status: | Closed | Start date: | 05/23/2012 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | Jaime Melis | % Done: | 0% | |
Category: | Packaging | |||
Target version: | Release 3.8 | |||
Resolution: | fixed | Pull request: | ||
Affected Versions: | OpenNebula 3.4 |
Associated revisions
Bug #1289: Improve centos init scripts
Bug #1289: Improve centos init scripts
(cherry picked from commit f01cfa07eb83776d588796ccdff3be61fe5545b4)
History
#1 Updated by Nicolas AGIUS about 9 years ago
- File oned-issue1289.patch added
- File one-acctd added
- File one-occid added
- File one-sunstoned added
As proposed by Francesco Camisa1, here is improved init script for CentoS.
Note that SystemV require a lock file in /var/lock/subsys/<script-name> for proper runlevel switch.
[1] http://lists.opennebula.org/pipermail/users-opennebula.org/2012-April/008584.html
#2 Updated by Ruben S. Montero almost 9 years ago
- Status changed from New to Assigned
#3 Updated by Jaime Melis over 8 years ago
There are some things I don't understand:
Can you please elaborate on this?
Note that SystemV require a lock file in /var/lock/subsys/<script-name> for proper runlevel switch.
As far as I can tell they're working fine for the moment, maybe I'm missing something?
Also, for instance in one-sunstoned, there's this line:
echo $(ps -ef|grep su[n]stone-server | awk '{print $2}') > $PID_FILE
Why the square brackets around the n? Why not used pidof?
#4 Updated by Jaime Melis over 8 years ago
By the way, I commited these scripts in the upstream repo: https://github.com/OpenNebula/one/tree/master/share/pkgs/CentOS
#5 Updated by Ruben S. Montero over 8 years ago
- Status changed from Assigned to Closed
- Resolution set to fixed
#6 Updated by Nicolas AGIUS over 8 years ago
Hello,
Sorry for the delay.
Can you please elaborate on this?
Note that SystemV require a lock file in /var/lock/subsys/<script-name> for proper runlevel switch.
Sure.
With RedHat System V, if you don't create an empty file in /var/lock/subsys/, with the same name of the init script, this script will not be handled when a runlevel change occur. ie. when you type "shutdown -h" or "reboot", the daemon will not be stopped.
The square brackets in the grep is an interesting hack from Francesco Camisa to avoid catching the grep itself.
Pidof does'nt work well because sunstone is a ruby process.
#7 Updated by Jaime Melis over 8 years ago
Patch applied! thanks for your explanation and patches