systemd 查看所有开机启动项

systemd 查看所有开机启动项可以使用 systemctl list-unit-files | grep enabled

systemd 查看所有开机启动项

systemctl list-unit-files | grep enabled

systemctl list-unit-files | grep redis
redis.service                          disabled

systemctl cat redis
# /lib/systemd/system/redis.service
[Unit]
Description=Redis
After=syslog.target network.target remote-fs.target nss-lookup.target

[Service]

User=redis
Group=redis

ExecStart=/usr/local/redis/bin/redis-server /etc/redis.conf
ExecStop=/usr/local/redis/bin/redis-cli -p 6379 shutdown
Restart=always

[Install]
WantedBy=multi-user.target