我已经使用本指南在我的服务器上安装了 postfix http://www.postfix.org/INSTALL.html#install
基本上创建我自己的包并安装。现在我想在服务器重新启动时自动启动 postfix。
我尝试添加符号链接,chkconfig --add postfix
但出现此错误:error reading information on service postfix: No such file or directory
我有 postfix 在服务器上运行得很好,期望这个。现在开始/停止后缀我使用
sudo postfix stop
sudo postfix start
Run Code Online (Sandbox Code Playgroud)
关于如何让它自己开始的任何想法?
chkconfig --add postfix
在 init 脚本存储库中需要一个 postfix init 脚本,通常是/etc/init.d
.
chkconfig
和update-rc.d
(debian) 只是在 中操作脚本/etc/rc#.d/
,其中#
默认设置的启动运行级别是/etc/inittab
与initdefault
term 一致的。我的情况是:
id:2:initdefault:
Run Code Online (Sandbox Code Playgroud)
然后/etc/rc2.d/
将调用符号链接。此链接的名称有一个模式[S|K]\d{1,}dstname
,例如:
$ ls -l /etc/rc2.d/ | grep postfix
lrwxrwxrwx 1 root root 17 Ago 16 09:04 S22postfix -> ../init.d/postfix
Run Code Online (Sandbox Code Playgroud)
S 表示/etc/init.d/postfix start
K 表示/etc/init.d/postfix stop
22是链接执行顺序。
然后您需要检查 inittab 以获取默认运行级别 ( initdefault
),检查链接/etc/rcX.d
( X is initdefault value), and have the link with a postfix startup script as target ( a script that support
start for S prefix links and
stop` 为 K 前缀链接 args)。
这就是 initsysv 系统的工作方式,但每个发行版都可能略有不同。
归档时间: |
|
查看次数: |
15838 次 |
最近记录: |