I have installed postfix on my server using this guide http://www.postfix.org/INSTALL.html#install
Basically creating my own package and installing. Now I want to start postfix automatically when the server reboots.
I have tried adding the symbolic link chkconfig --add postfix
but I get this error: error reading information on service postfix: No such file or directory
I have postfix running just fine on the server expect for this. To start/stop postfix now I use
sudo postfix stop
sudo postfix start
Any ideas on how to get it to start on its own?
Best Answer
chkconfig --add postfix
require a postfix init script inside init script repositories, commonly/etc/init.d
.chkconfig
andupdate-rc.d
(debian) just manipule scripts in/etc/rc#.d/
, where#
is the startup runrelevel that the default is set on/etc/inittab
on line withinitdefault
term. Im my case is:Then the symbolics links on
/etc/rc2.d/
will be called. The name of this links have a pattern[S|K]\d{1,}dstname
, e.g:S means
/etc/init.d/postfix start
K means/etc/init.d/postfix stop
22 is the links execution order.
Then you need check inittab to get default run level (
initdefault
), check the links on/etc/rcX.d
(X is initdefault value), and have the link with a postfix startup script as target ( a script that support
startfor S prefix links and
stop` for K prefix links args).This is how initsysv system works, but each distro can change a little.