添加到 init.d 的服务不显示 echo 信息,请问问题出在哪里

添加到 init.d 的服务不显示 echo 信息,请问问题出在哪里,第1张

1

BOYPT 288 天前 ♥ 1

在 systemd 里面,/etc/init.d 里面的文件已经不是在主要的服务启动方式,而是 systemd 的 service unit ,旧版的 init.d 文件通过 unit 配置文件里面类似下面这样的方式启动

[Service]

ExecStart=/etc/init.d/xxx start

ExecStop=/etc/init.d/xxx stop

脚本启动过程不是根据当前 shell 子进程启动的, stdin/out/err 都会被 systemd 接管,所以你看不到 echo 了。

/system/bin/screencap u:object_r:screencap_exec:s0

type screencap, domain,coredomain

type screencap_exec, exec_type,vendor_file_type,file_type

init_daemon_domain(screencap)

SystemProperties.set("ctl.start*", "xxx"),即可

这样 *** 作:

1、copy一个vsftpd一个启动脚本到/etc/init.d/目录下,名字为vsftpd。(也可以自己书写一个启动脚本)

2、执行chkconfig

add

vsftpd(也可以加--level参数指定部分init)

3、就可以执行service

vsftpd

start

/stop了。


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/bake/11375203.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-15
下一篇 2023-05-15

发表评论

登录后才能评论

评论列表(0条)

保存