[syslog-ng] Init scripts
Pal Tamas
folti at balabit.hu
Fri Jan 27 11:41:46 CET 2012
On Thu, Jan 26, 2012 at 11:54:47PM -0800, Chris Johnson wrote:
> My apologies, I know this is probably a trivial question. I trying to install syslog-ng for the first time from source. It appears to install okay, but the config file and init scripts are not installed during install. I am running Ubuntu 11.10 and tried to copy the init files from the debian folder, but this does not launch when I run /etc/init.d/syslog-ng start. Is there something else I need to configure? Copying the wrong files? Any help is greatly appreciated.
>
> Chris
Hi,
The initscript in the debian directory only works, if you build
syslog-ng with the settings required for a debian package, which are
different than the standard ./configure settings. (The init script
expects the syslog-ng binary to be located in /sbin. If it's not there,
it'll exit without an error.)
If you don't want to bother it, I recommend building a debian package
from the source, which both contain the syslog-ng binaries in proper
place and it'll register syslog-ng init script with upstart during the
install. For this, have to take the following steps:
1. Install the build-essential and fakeroot packages:
# sudo apt-get install build-essential fakeroot
2. into the extracted source and first run dpkg-checkbuilddeps, to see
what other packages you need to install before building syslog-ng.
# dpkg-checkbuilddeps
3. once all needed packages has been installed, build the syslog-ng
debian package:
#dpkg-buildpackage -b
4. After the succesful build, you'll find the .deb package in the
source's parent directory. To install it, you have to run
# dpkg -i <packagefilename>
Be aware, that this will remove the current syslogger and starts the
newly installed syslog-ng. If you want to get rid of syslog-ng just
reinstall the old syslogger using apt-get.
If you don't want to build the deb package, you have to modify the
initscript by replacing all instances of '/sbin/syslog-ng' with the
proper path to the binary and the content of the PIDFILE variable if
needed.
If it works, stop the current syslogger (from now I assume it's
rsyslog*):
# invoke-rc.d rsyslog stop
De-register it:
# update-rc.d rsyslog remove
Register syslog-ng:
# update-rc.d syslog-ng defaults 10 90
finally start it:
# invoke-rc.d syslog-ng start
* If your default syslogger is sysklogd, then you both have to stop and remove
the sysklogd and klogd services.
BE aware that in this case, the disabled sysloggers will be reactivated
the next time their packages will be updated by Ubuntu and you run
apt-get upgrade.
Regards,
--
Pal Tamas/Folti
folti at balabit.hu
More information about the syslog-ng
mailing list