Bug #1289

Improve centos init scripts

Added by Jaime Melis about 9 years ago. Updated over 8 years ago.

Status:ClosedStart date:05/23/2012
Priority:NormalDue date:
Assignee:Jaime Melis% Done:

0%

Category:Packaging
Target version:Release 3.8
Resolution:fixed Pull request:
Affected Versions:OpenNebula 3.4

oned-issue1289.patch Magnifier - Centos init script for oned (995 Bytes) Nicolas AGIUS, 05/25/2012 09:11 AM

one-acctd - Centos init script for oneacctd (1.52 KB) Nicolas AGIUS, 05/25/2012 09:11 AM

one-occid - Centos init script for OCCI (1.53 KB) Nicolas AGIUS, 05/25/2012 09:11 AM

one-sunstoned - Centos init script for sunstone (1.59 KB) Nicolas AGIUS, 05/25/2012 09:11 AM

Associated revisions

Revision f01cfa07
Added by Jaime Melis over 8 years ago

Bug #1289: Improve centos init scripts

Revision b68a36cb
Added by Jaime Melis over 8 years ago

Bug #1289: Improve centos init scripts
(cherry picked from commit f01cfa07eb83776d588796ccdff3be61fe5545b4)

History

#1 Updated by Nicolas AGIUS about 9 years ago

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

Also available in: Atom PDF