linux - ubuntu 关机时的命令

标签 linux ubuntu-10.04

ubuntu 关机时如何执行一个或多个命令和脚本?系统启动时是否有/etc/profile 和 ~/.bashrc 之类的脚本? 我知道linux shutdown可能有很多原因,除了处理kill signal外,这个原因哪里找?

最佳答案

Is there any script like /etc/profile and ~/.bashrc at system starting?

SysV Init 脚本 (/etc/init.d/*) 在启动时调用。在系统启动时调用某些事件的一种简单/简单的方法是将其放入 /etc/init.d/local (/etc/rc.local 对于其他一些发行版).另请参阅:RcLocalHowto .

How to execute one or more commands and scripts when ubuntu shutdown?

这听起来好像您想创建一个真正的 init 脚本,该脚本在进入运行级别 X-Z 时得到 started,在退出它们时得到 stopped。另请参阅:UbuntuBootupHowto .

I know linux shutdown may have many causes, in addition to dealing with the kill signal, where can I get for this reason?

非交互地做到这一点并不简单。您可以通过 grep 浏览系统日志,查找来自 shutdown 的指示。

关于linux - ubuntu 关机时的命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8529424/

相关文章:

vim - gVim 警告是什么以及如何消除它?

java - 如何在 ubuntu 10.04 环境中执行命令(带参数)

git - 错误 : gnutls_handshake() failed GIT repository

linux - socket编程中如何获取receiver的接收接口(interface)信息?

json - 如果嵌套数组为空,jq 将不返回任何内容

php - mysql_real_escape_string - 访问被拒绝,取决于执行脚本的用户?

Java 更新 : On LInux Mint the openjdk package doesn't update to the latest stable version

linux - 即使强制终止后,RHEL7 上的 httpd 服务也会自动重新启动

ruby-on-rails - Rails - capistrano 和 chmod

linux - Bash 'date -d' 错误?