【问题标题】:systemctl service not starting after system restart系统重启后systemctl服务未启动
【发布时间】:2016-03-16 15:18:08
【问题描述】:

我有这个服务,我希望能够在系统重新启动时作为服务启动。我正在使用 Ubuntu 15.10。服务配置文件如下所示:

[Unit]
Description=Service client 
After=syslog.target

[Service]
ExecStart=/bin/bash -c "/usr/local/bin/service_clientd start"
ExecStop=/bin/bash -c "/usr/local/bin/service_clientd stop"
Type=simple

[Install]
WantedBy=multi-user.target

服务用systemctl命令完美启动,但系统重启后不自动启动。

【问题讨论】:

    标签: linux restart systemd ubuntu-15.10


    【解决方案1】:

    这样做:

    systemctl enable servicename.service
    

    https://wiki.archlinux.org/index.php/systemd#Using_units

    【讨论】:

    • 正是我需要的!非常感谢! =D
    • 这样做我得到:cloudera-scm-server.service 不是本机服务,重定向到 /sbin/chkconfig。在上执行 /sbin/chkconfig cloudera-scm-server
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多