0

I have read the answer/comments for the thread Diffrence between /etc/init.d/ssh start and service ssh start.

But I need this /etc/init.d method to be working. I have some auto-generated scripts which invoke /etc/init.d method only. Could you kindly provide me some fix/workaround for this?

Melebius
  • 11,750
Sanjib
  • 11

2 Answers2

0

The last answer is a way to solve the defense4all installation problem about "Failed to start rsyslog service".This problem is caused by the bug of rsyslog (maybe, I found on the other webs), you can use service rsyslog instead of /etc/init.d/rsyslog, so you can edit the file in defense4all code files to solve this problem.

In the file:

../defense4all/dfapp.aggregate/src/install/config_rsyslog.bash

change the last sentences:

/etc/init.d/rsyslog stop > /dev/null 

to:

service rsyslog stop

and:

/etc/init.d/rsyslog stop > /dev/null   

to:

service rsyslog start

And then rebuild the project to create .deb or .rpm files.Hope this may help you.

KGIII
  • 4,101
Yona
  • 1
0

You faced this problem because the rsyslog script in newer Ubuntu is written to be handled by upstart and not the traditional init daemon.

I saw your fix in the comments above. Another workaround that allows your automation scripts to continue using /etc/init.d/rsyslog start|stop is -

Edit the file /etc/init.d/rsyslog , comment/delete all instances of following code block -

if init_is_upstart; then
    exit 1 (or exit 0)
fi

Now

/etc/init.d/rsyslog start|stop

should work.

For more information, see this.

Siddu
  • 1
  • 1