0001-create-dir-for-pid-file-if-not-exist-check-write-per.patch

patch to create /var/run/one and check write permissions - Robert Schweikert, 06/13/2011 02:41 PM

Download (1.47 KB)

View differences:

share/scripts/one
17 17
#--------------------------------------------------------------------------- #
18 18

  
19 19
if [ -z "$ONE_LOCATION" ]; then
20
    ONE_PID=/var/run/one/oned.pid
20
    ONE_PIDDIR=/var/run/one
21
    ONE_PID=$ONE_PIDDIR/oned.pid
21 22
    ONE_SCHEDPID=/var/run/one/sched.pid
22 23
    ONE_CONF=/etc/one/oned.conf
23 24
    ONE_DB=/var/lib/one/one.db
......
28 29

  
29 30
    LOCK_FILE=/var/lock/one/one
30 31
else
31
    ONE_PID=$ONE_LOCATION/var/oned.pid
32
    ONE_PIDDIR=$ONE_LOCATION/var
33
    ONE_PID=$ONE_PIDDIR/oned.pid
32 34
    ONE_SCHEDPID=$ONE_LOCATION/var/sched.pid
33 35
    ONE_CONF=$ONE_LOCATION/etc/oned.conf
34 36
    ONE_DB=$ONE_LOCATION/var/one.db
......
53 55
        exit 1
54 56
    fi
55 57

  
58
    if [ ! -d $ONE_PIDDIR ]; then
59
        mkdir $ONE_PIDDIR
60
    fi
61

  
62
    if [ ! -w $ONE_PIDDIR ]; then
63
        echo "$ONE_PIDDIR is not writable, cannot start oned or scheduler."
64
        exit 1
65
    fi
66

  
56 67
    if [ -f $LOCK_FILE ]; then
57 68
        if [ -f  $ONE_PID ]; then
58 69
            ONEPID=`cat $ONE_PID`
59
-