systemctl enable redis-server.service
Failed to execute operation: Bad message
出现这个问题可能是我们脚本问题,网上找了一个开启启动脚本如下,结果报上面的错误
[Unit] Description=The redis-server Process Manager After=syslog.target network.target [Service] Type=simple PIDFile=/var/run/redis_6379.pid ExecStart=/usr/local/redis/redis-server /usr/local/redis/redis.conf ExecReload=/bin/kill -USR2 $MAINPID ExecStop=/bin/kill -SIGINT $MAINPID [Install] WantedBy=multi-user.target
正确的脚本应该是这个开机启动脚本
[Unit] Description=Redis After=network.target [Service] ExecStart=/usr/local/bin/redis-server /usr/local/redis/redis.conf --daemonize no ExecStop=/usr/local/bin/redis-cli -h 127.0.0.1 -p 6379 shutdown [Install] WantedBy=multi-user.target
最后再执行
systemctl enable redis-server.service
Ok,完美解决,不报错。
文章评论(0)