Questions tagged «init.d»

init.d目录包含许多用于系统上各种服务的启动/停止脚本。




1
systemctl init.d和service之间的区别
我是Linux新手,并且一直在使用Amazon Lightsail实例(Ubuntu 16.04 LTS)测试自己。 通过我遇到的许多指南,我看到人们使用不同的命令来启动/停止/重新启动/重新加载/状态检查服务。特别是这些; sudo systemctl status apache2.service sudo /bin/systemctl status apache2.service sudo /etc/init.d/apache2 status sudo service apache2 status 以上所有命令均有效。 我是否应该优先选择一个命令? 如果是,那为什么呢? 我还有其他需要注意的命令吗? 当我想使用状态选项时,在Monit中使用init.d会引起问题(状态是该服务实际上处于联机状态,但该服务已脱机-由Monit重新启动)。将Monit中的代码从inid.d更改为/ bin / systemctl对其进行修复。 看来使用init.d可以提供有关其他情况的更多信息。如果我应该使用其他命令之一,是否可以让它们显示有关执行的更多信息? ubuntu@ip-172-26-12-245:~$ sudo systemctl restart pure-ftpd.service ubuntu@ip-172-26-12-245:~$ sudo /bin/systemctl restart pure-ftpd.service ubuntu@ip-172-26-12-245:~$ sudo /etc/init.d/pure-ftpd restart [ ok ] Restarting pure-ftpd (via systemctl): …

18
无法启动mysql-mysql重新生成速度太快,已停止
今天,我重新安装了ubuntu 12.04,然后开始设置本地开发环境。我安装了mysql并进行了编辑/etc/mysql/my.cnf以优化InnoDB,但是当我尝试重新启动mysql时,它失败并出现错误: [20:53][tom@Pochama:/var/www/website] (master) $ sudo service mysql restart start: Job failed to start 系统日志显示初始化脚本存在问题: > tail -f /var/log/syslog Apr 28 21:17:46 Pochama kernel: [11840.884524] type=1400 audit(1335644266.033:184): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=760 comm="apparmor_parser" Apr 28 21:17:47 Pochama kernel: [11842.603773] init: mysql main process (764) terminated with status 7 Apr 28 21:17:47 …
33 mysql  init.d  apparmor 

1
卸载init.d update-rc.d删除
我使用以下命令安装了init.d脚本: sudo update-rc.d mongodb defaults 98 02 我想卸载它,所以我计划运行: sudo update-rc.d -f mongodb remove 我担心安装命令中的启动和停止条件。 运行删除程序是否还会删除启动条件和停止条件? 有什么我应该意识到的含义吗?
27 init.d 

5
如何在系统重启时自动重启Tomcat7?
这个问题是从Stack Overflow 迁移过来的,因为可以在Ask Ubuntu上回答。 迁移 7年前。 我已经在运行于Amzon EC2实例的Ubuntu 12.04 LTS上安装了Tomcat 7。现在,我希望tomcat应该在系统重新启动时自动重新启动。 我读了这个博客,建议在下面添加以下脚本/etc/init.d/tomcat7: # Tomcat auto-start # # description: Auto-starts tomcat # processname: tomcat # pidfile: /var/run/tomcat.pid case $1 in start) sh /usr/share/tomcat7/bin/startup.sh ;; stop) sh /usr/share/tomcat7/bin/shutdown.sh ;; restart) sh /usr/share/tomcat7/bin/shutdown.sh sh /usr/share/tomcat7/bin/startup.sh ;; esac exit 0 并发出以下命令: sudo chmod 755 …
26 scripts  init.d  tomcat 

5
如何正确地将自定义守护程序添加到init.d?
我有一个第三方专有应用程序服务器守护程序,该守护程序可以通过几个命令行来启动和停止。我需要该守护程序在系统启动时启动,并在系统关闭时正确停止。我该如何正确实施?在/etc/init.d中复制一些脚本并进行相应修改是否足够?


9
haproxy无法启动
安装了新的Ubuntu 10.04服务器并以root用户身份登录,我使用apt-get安装了haproxy。 我可以将haproxy直接作为守护程序运行,但是当我什么/etc/init.d/haproxy start也不做时..甚至没有错误消息。 netstat -a 显示没有任何内容正在使用我试图与haproxy保持平衡的http端口... 有想法吗? 编辑 我注意到apt-get install haproxy最后说的是: update-rc.d:警告:/etc/init.d/haproxy缺少LSB信息update-rc.d:请参见http://wiki.debian.org/LSBInitScripts /etc/default/haproxy 说 ENABLED=1 调试输出 sh -xv /etc/init.d/haproxy start #!/bin/sh # # chkconfig: - 85 15 # description: HA-Proxy is a TCP/HTTP reverse proxy which is particularly suited \ # for high availability environments. # processname: haproxy # …
20 10.04  server  init.d 

4
如何摆脱cloud-init?
我将Ubuntu 14.04映像用作流浪汉的基本框。不幸的是,此基本框包含cloud-init,这会在启动计算机时导致许多问题:https : //github.com/mitchellh/vagrant/issues/3860 我没有在云中使用我的机器,所以我真的不需要这个。我虽然输入: sudo apt-get remove cloud-init 可以解决我的问题,但是机器仍然会花费大约3分钟的启动时间来尝试配置不需要的东西。 我可以看到有在AA号码的云初始化相关的文件/etc/init(例如cloud-init.conf,cloud-final.conf,cloud-config.conf等)。我可以删除它们,但不确定是否安全。 我还安装rcconf了检查所有starup脚本的程序,但在那里找不到与cloud-init相关的任何内容。有任何想法吗?

2
如何设置服务?
我有一个脚本,希望在我的Ubuntu Server 11.04无头盒上作为服务运行。也就是说,我想在/etc/init.d/下拥有正确的文件,并能够通过service命令对其进行控制。 是否有任何指南可以告诉我该如何做?



5
无法启动<myapp> .service:找不到单元<myapp> .service
我为我的python机器人创建了一个超基本的init.d脚本: #!/bin/bash # chkconfig: 2345 20 80 # description: Description comes here.... # Source function library. . /etc/init.d/functions start() { echo "starting torbot" python /home/ctote/dev/slackbots/torbot/torbot.py # example: daemon program_name &amp; } stop() { # code to stop app comes here # example: killproc program_name } case "$1" in start) start …

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.