test1:~ # start_udev
-bash:where:command not found
原来是SUSE Linux上的udev命令与RedHat系列不同
而SUSE系统中udev的命令为:
test1:~ # /etc/init.d/boot.udev status
Checking for udevd: running
test1:~ # /etc/init.d/boot.udev restart
Restarting udevd: done
方法一使用 /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/local12345678910111213
复制代码 在《Linux就该这么学》中有命令大全查看命令
1、授予 /etc/rc.d/rc.local 文件执行权限
命令:chmod +x /etc/rc.d/rc.local
2、在文件文件底部添加脚本
3、重启服务器,查看脚本是否启动
注意:/etc/rc.d/rc.local脚本执行,在/etc/profile之前,若/etc/rc.d/rc.local用到/etc/profile的环境变量,Shell无法执行成功
可以把这个aliasshut=shutdown
-h
now
命令保存到home目录下的.bashrc文件中,
这样重启后也会有效。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)