ubuntu系统自启制作

oeasy@localhost:/etc/systemd/system$ ls bluetooth.target.wants dbus-org.freedesktop.nm-dispatcher.service face_upgrade.service graphical.target.wants multi-user.target.wants sockets.target.wants sysinit.target.wants dbus-org.bluez.service default.target final.target.wants hibernate.target.wants network-online.target.wants sshd.service syslog.service dbus-org.freedesktop.Avahi.service display-manager.service getty.target.wants hybrid-sleep.target.wants printer.target.wants suspend.target.wants timers.target.wants

oeasy@localhost:/etc/systemd/system$ cat face_upgrade.service ## vim face_upgrade.service ## 创建face_upgrade.service文件,root用户权限下编辑

[Unit] Description=face node upgrade service After=network.target

[Service] User=root ## 可不写此行

WorkingDirectory=/home/oeasy/Client ExecStart=/usr/bin/python /home/oeasy/Client/check_crontab.py ExecReload=/bin/kill -HUP $MAINPID KillMode=process Restart=always RestartSec=10s

[Install] WantedBy=multi-user.target

=============================================================================================================

[Install] WantedBy=multi-user.target oeasy@localhost:/etc/systemd/system$ systemctl enable face_upgrade ==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-unit-files === Authentication is required to manage system service or unit files. Authenticating as: oeasy Password:

oeasy@localhost:/etc/systemd/system$ systemctl start face_upgrade
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units === Authentication is required to start 'face_upgrade.service'. Authenticating as: oeasy Password:

=============================================================================================================

oeasy@localhost:/etc/systemd/system$ systemctl stop face_upgrade
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units === Authentication is required to stop 'face_upgrade.service'. Authenticating as: oeasy Password:

oeasy@localhost:/etc/systemd/system$ ps -ef | grep check oeasy 19878 17024 0 10:41 pts/1 00:00:00 grep --color=auto check oeasy@localhost:/etc/systemd/system$ systemctl start face_upgrade

==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units === Authentication is required to start 'face_upgrade.service'. Authenticating as: oeasy Password: ==== AUTHENTICATION COMPLETE ===

oeasy@localhost:/etc/systemd/system$ ps -ef | grep check
root 19891 1 9 10:41 ? 00:00:00 /usr/bin/python /home/oeasy/Client/check_crontab.py oeasy 19897 17024 0 10:41 pts/1 00:00:00 grep --color=auto check

oeasy@localhost:/etc/systemd/system$ sudo kill 19891 sudo: unable to resolve host localhost.localdomain

oeasy@localhost:/etc/systemd/system$ ps -ef | grep check root 19945 1 18 10:42 ? 00:00:00 /usr/bin/python /home/oeasy/Client/check_crontab.py oeasy 19951 17024 0 10:42 pts/1 00:00:00 grep --color=auto check

============================================================================================================= 文件路径: /etc/systemd/system

[Unit] Description=face node upgrade service After=network.target

[Service] User=root ## 默认root权限启动可去掉

WorkingDirectory=/home/oeasy/Client ExecStart=/usr/bin/python /home/oeasy/Client/check_crontab.py ExecReload=/bin/kill -HUP $MAINPID KillMode=process Restart=always RestartSec=10s

[Install] WantedBy=multi-user.target

sudo systemctl daemon-reload 重启一下


文件路径: /etc/systemd/system

[Unit] Description=face node upgrade service After=network.target

[Service] User=root ## 默认root权限启动可去掉

WorkingDirectory=/home/oeasy/Client # 目录 ExecStart=/usr/bin/python /home/oeasy/Client/check_crontab.py # 执行脚本 ExecReload=/bin/kill -HUP $MAINPID KillMode=process Restart=always RestartSec=10s

[Install] WantedBy=multi-user.target

点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

MySQL部分从库上面因为大量的临时表tmp_table造成慢查询

背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_

皕杰报表之UUID

​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为

swap空间的增减方法

(1)增大swap空间去激活swap交换区:swapoff v /dev/vg00/lvswap扩展交换lv:lvextend L 10G /dev/vg00/lvswap重新生成swap交换区:mkswap /dev/vg00/lvswap激活新生成的交换区:swapon v /dev/vg00/lvswap

2020年前端实用代码段,为你的工作保驾护航

有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )

ubuntu系统自启制作 - HelloWorld