[one-users] startup script should create dir if not present

Jaime Melis jmelis at opennebula.org
Tue Jun 7 03:30:59 PDT 2011


Hi Robert,

thanks for reporting this, it makes total sense. We will update the package
for the next release.

thanks for the patch!

regards,
Jaime

On Thu, Jun 2, 2011 at 4:01 PM, Robert Schweikert <rschweikert at novell.com>wrote:

> Hi,
>
> IMHO the "one" startup script should create the directory for the pid files
> if the directory is not present. Reason is that /var/run may be located on a
> tmpfs and thus it might go away with every boot. Expecting the sysadmin to
> create the directory every time or writing her/his own script appears to me
> not very user friendly.
>
> Here is the patch I am applying in OBS to build the SUSE package.
>
> --- share/scripts/one.orig
> +++ share/scripts/one
> @@ -17,6 +17,7 @@
>
> #---------------------------------------------------------------------------
> #
>
>  if [ -z "$ONE_LOCATION" ]; then
> +    ONE_PIDDIR=/var/run/one
>     ONE_PID=/var/run/one/oned.pid
>     ONE_SCHEDPID=/var/run/one/sched.pid
>     ONE_CONF=/etc/one/oned.conf
> @@ -28,6 +29,7 @@ if [ -z "$ONE_LOCATION" ]; then
>
>     LOCK_FILE=/var/lock/one/one
>  else
> +    ONE_PIDDIR=$ONE_LOCATION/var
>     ONE_PID=$ONE_LOCATION/var/oned.pid
>     ONE_SCHEDPID=$ONE_LOCATION/var/sched.pid
>     ONE_CONF=$ONE_LOCATION/etc/oned.conf
> @@ -53,6 +55,10 @@ setup()
>         exit 1
>     fi
>
> +    if [ ! -d $ONE_PIDDIR ]; then
> +       mkdir $ONE_PIDDIR
> +    fi
> +
>     if [ -f $LOCK_FILE ]; then
>         if [ -f  $ONE_PID ]; then
>             ONEPID=`cat $ONE_PID`
>
> The directories required in /var/lock and /var/log are created by the
> package in %post. However, for general use of OpenNebula outside of a
> package install it might make sense to have the "one" startup script create
> these directories as well. Although, since neither /var/lock nor /var/log
> are expected on tmpfs, AFAIK, the creation is a one time setup task and thus
> may not be desired in the "one" startup script.
>
>
> Robert
> --
> Robert Schweikert                           MAY THE SOURCE BE WITH YOU
> SUSE-IBM Software Integration Center                   LINUX
> Tech Lead
> rschweikert at novell.com
> rschweikert at ca.ibm.com
> 781-464-8147
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>



-- 
Jaime Melis, Cloud Technology Engineer/Researcher
Major Contributor
OpenNebula - The Open Source Toolkit for Cloud Computing
www.OpenNebula.org | jmelis at opennebula.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20110607/32a7198d/attachment-0003.htm>


More information about the Users mailing list