标签:pos win ons 参考 window 内容 mod system dde
以消息队列RabbitMQ为例
vim /usr/local/rabbitmq/sbin/start_rabbitmq.sh
[编写自启内容]
#!/bin/bash
#erlang
export PATH=$PATH:/usr/rabbitmq/erlang/bin
#rabbitmq
export HOME=/usr/rabbitmq/rabbitmq/
/usr/rabbitmq/rabbitmq/sbin/./rabbitmq-server -detached
-detached:以后台守护进程方式运行
chmod +x /usr/local/rabbitmq/sbin/start_rabbitmq.sh
vim /etc/rc.d/rc.local
[编辑内容:↓]
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run ‘chmod +x /etc/rc.d/rc.local‘ to ensure
# that this script will be executed during boot.
touch /var/lock/subsys/local
#↓我们编写的启动脚本
/usr/local/rabbitmq/sbin/start_rabbitmq.sh
chmod +x /etc/rc.d/rc.local
shutdown -r now
[解决办法]
使用在终端输入: sed -i ‘s/\r$//‘ my-johnnyzen-shell.sh即可
[原因分析]
此shell脚本文件在Windows 下编辑过,在Windows下每一行结尾是\n\r,而Linux下则是\n
sed -i ‘s/\r$//‘ make-all-linux-project.sh 会把make-all-linux-project.sh中的行尾的\r替换为空白
标签:pos win ons 参考 window 内容 mod system dde
原文地址:https://www.cnblogs.com/johnnyzen/p/13121071.html