Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux systemd强制服务在CentOS 7.1中继续之前完成_Linux_Systemd - Fatal编程技术网

Linux systemd强制服务在CentOS 7.1中继续之前完成

Linux systemd强制服务在CentOS 7.1中继续之前完成,linux,systemd,Linux,Systemd,我需要先完成一项服务,然后才能让Linux继续启动。我宁愿不必在我的.service文件中的Before=语句中指定每个服务和目标。在SysVInit中,我只是用chkconfig指定了我想要的起始编号 我已尝试定义foo.target和foo.service,并将其设置为require=和after=用于网络.target(我需要联网)以及before=多用户.target。这似乎不起作用。我已经设置了foo.target.want目录,使其具有指向foo.service的符号链接 我试着在s

我需要先完成一项服务,然后才能让Linux继续启动。我宁愿不必在我的
.service
文件中的
Before=
语句中指定每个服务和目标。在SysVInit中,我只是用chkconfig指定了我想要的起始编号

我已尝试定义
foo.target
foo.service
,并将其设置为
require=
after=
用于
网络.target
(我需要联网)以及
before=多用户.target
。这似乎不起作用。我已经设置了
foo.target.want
目录,使其具有指向
foo.service
的符号链接

我试着在
system.conf
中打开debug,看看哪里出了问题,结果很糟糕


任何帮助都将不胜感激

我终于让一切都按我想要的方式运行了。这并不漂亮,但是

我将
systemd
默认值更改为需要什么服务的特殊目标,并在最后运行我的脚本。在我的脚本结束时,发出了systemctl isolate multi-user。我已经验证了它是否按预期工作