2、使用sudo systemctl enable 命令添加到开机启动项
1、新增文件
vi /usr/lib/systemd/system/redis.service
添加以下内容:
[Unit]
Description=Redis Server Manager
After=network.target
[Service]
Type=forking
PIDFile=/var/run/redis_6379.pid
ExecStart=/usr/local/bin/redis-server /etc/redis.conf
ExecReload=/bin/kill -USR2 $MAINPID
ExecStop=/bin/kill -SIGINT $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target
EOF
2、添加开机启动
sudo systemctl enable redis.service
1、首先,同时按CTRL+ALT+T键,打开终端。
2、deepin linux使用的是lightdm启动器,它是默认开机启动的。
3、通过执行如下命令将其禁止开机自启动即可,sudo systemctl disable lightdm。
4、再查看开机启动状态已经关掉了。
5、这时候使用sudo shutdown -r now重启一下电脑。
6、再次开机如下图所示就进入命令行模式了。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)