File tree 3 files changed +26
-14
lines changed
ircDDBGateway/ircDDBGateway
3 files changed +26
-14
lines changed Original file line number Diff line number Diff line change @@ -57,12 +57,18 @@ do_start()
57
57
# 1 if daemon was already running
58
58
# 2 if daemon could not be started
59
59
60
- # Check if the PID file exists and the actual status of the process
61
- if [ -e $PIDFILE ]; then
62
- status_of_proc -p $PIDFILE $DAEMON_PATH " $NAME process" && status=" 0" || status=" $? "
63
- # If the status is SUCCESS then don't need to start again.
64
- if [ $status = " 0" ]; then
65
- return 1 # Exit
60
+ # Check if the PID directory and file exists and the actual status of the process
61
+ PIDDIR=$( dirname " $PIDFILE " )
62
+ if [ ! -d " $PIDDIR " ]; then
63
+ mkdir $PIDDIR
64
+ chown $DAEMON_USER $PIDDIR
65
+ else
66
+ if [ -e $PIDFILE ]; then
67
+ status_of_proc -p $PIDFILE $DAEMON_PATH " $NAME process" && status=" 0" || status=" $? "
68
+ # If the status is SUCCESS then don't need to start again.
69
+ if [ $status = " 0" ]; then
70
+ return 1 # Exit
71
+ fi
66
72
fi
67
73
fi
68
74
Original file line number Diff line number Diff line change @@ -57,12 +57,18 @@ do_start()
57
57
# 1 if daemon was already running
58
58
# 2 if daemon could not be started
59
59
60
- # Check if the PID file exists and the actual status of the process
61
- if [ -e $PIDFILE ]; then
62
- status_of_proc -p $PIDFILE $DAEMON_PATH " $NAME process" && status=" 0" || status=" $? "
63
- # If the status is SUCCESS then don't need to start again.
64
- if [ $status = " 0" ]; then
65
- return 1 # Exit
60
+ # Check if the PID directory and file exists and the actual status of the process
61
+ PIDDIR=$( dirname " $PIDFILE " )
62
+ if [ ! -d " $PIDDIR " ]; then
63
+ mkdir $PIDDIR
64
+ chown $DAEMON_USER $PIDDIR
65
+ else
66
+ if [ -e $PIDFILE ]; then
67
+ status_of_proc -p $PIDFILE $DAEMON_PATH " $NAME process" && status=" 0" || status=" $? "
68
+ # If the status is SUCCESS then don't need to start again.
69
+ if [ $status = " 0" ]; then
70
+ return 1 # Exit
71
+ fi
66
72
fi
67
73
fi
68
74
Original file line number Diff line number Diff line change @@ -119,9 +119,9 @@ int main(int argc, char** argv)
119
119
120
120
wxString pidFileName;
121
121
if (!name.IsEmpty ())
122
- pidFileName.Printf (wxT (" /var/run/ircddbgateway_%s.pid" ), name.c_str ());
122
+ pidFileName.Printf (wxT (" /var/run/opendv/ ircddbgateway_%s.pid" ), name.c_str ());
123
123
else
124
- pidFileName = wxT (" /var/run/ircddbgateway.pid" );
124
+ pidFileName = wxT (" /var/run/opendv/ ircddbgateway.pid" );
125
125
pidFileName.Replace (wxT (" " ), wxT (" _" ));
126
126
127
127
char fileName[128U ];
You can’t perform that action at this time.
0 commit comments