刘总的笔记小站

生活常识,娱乐搞笑,编程技巧,智能家居,深度学习,网络神经,数据挖掘

linux mint 设置自动启动程序


1,命令行调整:

cat /etc/default/grub
sudo vim /etc/default/grub
sudo update-grub
sudo reboot


2,设置用户自动登陆; 否则无法自动接入wifi

image.png


3,设置自动锁屏;

image.png

1,添加系统服务;

A ,对于树梅派,strech lite os,可以直接将 autohots.service 服务配置 直接扔到 /etc/systemd/system/multi-user.target.wants/目录,修改 777 权限; 重启系统就会自动启动;

B ,对于linux mint 19.3,需要将  autohots.service  服务配置 扔到 /etc/systemd/system/ 目录下;建立软链接 到 multi-user.target.wants 下;  重启系统就会自动启动;

等效的操作命令:


1)编辑服务配置

sudo vim /etc/systemd/system/autohots.service

2,粘贴如下内容

[Unit]
Description=raspberry auto update hots to database
Documentation=http://liuzongandy.com
After=rc-local.service
After=network.target

[Service]
Type=simple
PIDFile=/run/autohots.pid
User=root
Restart=on-failure
RestartSec=3s
ExecStartPre=/usr/bin/test /home/andy/go/src/awesomeAdminVue/wesomeAdmin
ExecStart=/home/andy/go/src/awesomeAdminVue/wesomeAdmin
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID

[Install]
WantedBy=multi-user.target


3,服务管理

sudo systemctl enable autohots.service
sudo systemctl start autohots.service
sudo systemctl stop autohots.service
sudo systemctl restart autohots.service
sudo systemctl disable autohots.service

sudo systemctl daemon-reload
systemctl status autohots.service


等价纯手工:
cp autohots.service /etc/systemd/system/
cd /etc/systemd/system/
cd /etc/systemd/system/multi-user.target.wants/
sudo ln -s /etc/systemd/system/autohots.service autohots.service
sudo chmod 777 /etc/systemd/system/multi-user.target.wants/autohots.service
sudo reboot


4, ALT+F12 可以将当前窗口钉到最前面



发表评论:

控制面板
您好,欢迎到访网站!
  查看权限
搜索
«   2024年9月   »
1
2345678
9101112131415
16171819202122
23242526272829
30
网站分类
最新留言
文章归档
网站收藏
友情链接
图标汇集
Powered by Z-BlogPHP

  • Copyright ©2021 @liuzong All rights reserved.
  • 陕ICP备17016542号