Tag Info

Hot answers tagged

99

/etc/init.d contains scripts used by the System V init tools (SysVinit). This is the traditional service management package for Linux, containing the init program (the first process that is run when the kernel has finished initializing¹) as well as some infrastructure to start and stop services and configure them. Specifically, files in /etc/init.d are shell ...


56

You can simply use the initctl list shell command to list the contents of /etc/init rather than the suggested dbus-send command.


30

When you copy the script into place, don't forget to make it executable and owned by root: sudo chmod +x /etc/init.d/celeryd sudo chown root:root /etc/init.d/celeryd Once you have installed that, you can set it to start automatically on boot with: sudo update-rc.d celeryd defaults sudo update-rc.d celeryd enable


29

Your celeryd script is probably not executable, that's why sudo /etc/init.d/celeryd is returning command not found. So, you need to first make it executable. To do so, run the following commands: sudo chmod 755 /etc/init.d/celeryd sudo chown root:root /etc/init.d/celeryd The first line changes the permissions to -rwxr-xr-x, and the second line ensures ...


27

Edit /etc/default/haproxy and make sure it has a line that says ENABLED=1 in it. The default is ENABLED=0. This is done because haproxy has no sane default configuration, so you need to first configure it, then enable it.


27

I finally figured out the issue. Basically, the definition of some parameters has been removed from the previous version of mysql and has been replaced with different names. To fix, in /etc/mysql/my.cnf, replace: # Tom Added to ensure the server character set is set to utf8 default-character-set = utf8 default-collation = utf8_general_ci with: # Tom ...


25

You can use the following commands: service <servicename> stop service <servicename> start service <servicename> restart Note service --status-all doesn't stop or start anything, it just returns a status (and there's some known bugs in it). If you have upstart then you can use these: stop <servicename> start ...


19

Create the init script in /etc/init.d/tomcat7 with the contents as per below (your script should work too but I think this one adheres more closely to the standards). This way Tomcat will start only after network interfaces have been configured. Init script contents: #!/bin/bash ### BEGIN INIT INFO # Provides: tomcat7 # Required-Start: $network # ...


18

It depends largely on the service. The new and preferred way to stop start and restart services is through /etc/init.d. So, for example, to stop or start the Apache Webserver, you can run /etc/init.d/apache2 stop /etc/init.d/apache2 start The same is true of many other services, but probably not all. You can use the utility sysv-rc-conf to see which ...


14

init.d is the old, deprecated system for starting daemons; is has been supplanted by upstart. Upstart has the advantage of being far easier to configure and allows proper sequencing of task initialization. The configuration files for upstart live in /etc/init and if your daemon has no pre-requisites it can be as simple as tty1.conf: # tty1 - getty # # This ...


11

The ".d" is usually appended to a directory name to indicate that what used to be (or what could have been) handled by a single script or a single configuration file has been split into multiple files for the sake of convenience, but which should be included, or executed, together. For example, /etc/apache/conf.d/ or /etc/apt/sources.d/ In cases where it's ...


11

This is quite confusing. But generally you can edit /etc/default/tor and change RUN_DAEMON="yes" to RUN_DAEMON="no". Now Vidalia should start its own tor and tor should not start at startup.


10

Had the same issue on Ubuntu 15.04 Resolved it by creating a new file: /etc/systemd/system/plexmediaserver.service Afterwards, pasted the following: [Unit] Description=Plex Media Server for Linux After=network.target [Service] Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/lib/plexmediaserver/Library/Application Support" ...


10

Unless you are using 15.04 or any later release (which uses systemd), you will probably be better off if you turn your script into an Upstart job, rather than follow the examples you'll find in /etc/init.d/ (which are System V-style init scripts, which Ubuntu and other distributions are moving away from). The Upstart Cookbook has an enormous amount of ...


10

Innodb has a default setting (innodb_buffer_pool_size) which is set to 128M - this may be too large for your server (especially if you're using a small Amazon EC2 AMI - which I was) The fix that worked for me was to add the following line to /etc/mysql/my.cnf innodb_buffer_pool_size = 16M I wrote about this fix over here ...


9

As you point out, the ".d" nomenclature is puzzling and strange, and doesn't really have any place in any modern system -- you'll notice that most modern services have tended to drop it. The reason the directory is /etc/init and not /etc/upstart is because Upstart is the project name, the actual installed binary is still /sbin/init thus it would not make ...


9

Will running the remove cause the start and stop conditions to be removed also? It will remove any instance of your script from the system, meaning, any link in /etc/rc*runlevel*.d to the mongodb script in your /etc/init.d. Are there any implications that I should be aware of? If some other script depends of mongodb to start/stop it will fail. ...


8

You cannot make a script that runs from init.d and displays a gnome-terminal window, because scripts in init.d run before there is any login session in which to display one. They run even before the graphical user interface is running. Logging to a File Instead If you need to run this script when the machine boots up, then instead of trying to make it ...


8

The /etc/init.d and /etc/rc.* directories have been superseded by the 'upstart' init tool. Although scripts in these directories will be executed as expected, the new method for running things on init is defined by files in /etc/init/ You can list all of the upstart jobs with by querying upstart over dbus: dbus-send --print-reply --system ...


8

The various PostgreSQL command line tools will talk to the server listening on the default port (5432) by default. You can determine which port each server is listening on by looking for the port variable in the /etc/postgresql/$VERSION/main/postgresql.conf file for the relevant server. To get the command line tools to talk to the other server by default, ...


8

If you want to do this as system startup (as opposed to when you log in to your computer), put the commands you want to run in /etc/rc.local. See [Ubuntu] Executing a script at startup and shutdown.


8

Here is a very simple example how to create an upstart script: https://wiki.frugalware.org/index.php/Upstart_Job_HOWTO UPDATE: above link is broken. Here is an example of a script: description "My startup service" author "You or someone else" version "3.14" pre-start script echo 'Starting my service ...' end script start on net-device-up stop on ...


7

if you do not want to migrate to UPSTART, but want the classic approach, you must: NOTE: i am saving the service and the program with the same name in different directories (but you can change this, as long as it is reflected in your service file). change "myscriptname" and "myprogramname" to real names! save your program that will run as a service in ...


7

You can try to run this in terminal: sudo chmod 755 /etc/init.d/couchpotato sudo update-rc.d couchpotato defaults ================================ And when you want to disable it from running at startup: sudo update-rc.d -f couchpotato remove To find out more information do: man update-rc.d


7

You can customize which commands the user can run via sudo in /etc/sudoers (using visudo): username: ALL = /etc/init.d/virtuoso


7

I had a similar problem. It was frustrating because I couldn't see any error logs indicating what the problem was. In my case, the value I had set for innodb_buffer_pool_size was too large for the memory of the server. I found this out by running mysqld directly as the mysql user. # su mysql # mysqld This way you actually see the error output.


6

Dropbox is not started at boot time, there is no init.d script to do it. The daemon is started at login for each user and the binaty is located in ~/.dropbox-dist/dropbox. To start up the daemon you need to use the command start-stop-daemon -b -o -c user -S -u user -x ~/.dropbox-dist/dropbox and to stop it you need to use start-stop-daemon -o -c user -K ...


6

sudo service transmission-daemon stop is the way to go.


6

Per default samba active directory and domain controller service will be started in addition to smbd and nmbd. For a standalone server this is not neccesary. Just set the service to manual startup to get rid of the [fail] message with the following statement as root: echo manual | tee /etc/init/samba-ad-dc.override



Only top voted, non community-wiki answers of a minimum length are eligible