Tag Info

Hot answers tagged

61

/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 ...


38

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


25

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.


25

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 ...


21

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 ...


18

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


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 ...


18

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 ...


10

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 ...


10

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 # ...


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

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 information about how Upstart jobs work. Although I wouldn't describe it ...


9

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 You should place the script in /etc/init/yourfilename.conf Then reload the configuration with: sudo initctl reload-configuration And if all is OK, you should be able to start it with: sudo start yourfilename


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

This is quite confusing. Generally you can edit /etc/default/tor and set there RUN_DEAMON="no". Now Vidalia should start its own tor and tor should not start at startup.


7

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. ...


7

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 ...


6

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 ...


6

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


6

It might sound a bit strange but it does not. To be more exact, it displays only unknown [?] statuses on the standard error (besides other error messages). You can see the script in /usr/sbin/services. The relevant part is the following (lines 68--98): if [ -z "${SERVICE}" -a $# -eq 1 -a "${1}" = "--status-all" ]; then cd ${SERVICEDIR} for ...


6

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 ...


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 ...


5

You could add it to /etc/rc.local before the line that says exit 0. This way it will run at boot every time. To add the command using one line: sudo sed --in-place '/^exit 0/i\cd /opt/appdir\npython manage.py runserver .... &' /etc/rc.local


5

Adding the autossh Command On the panel select System --> Preferences --> Startup Applications. Under the Startup Programs tab select the Add button. Choose any Name you want and paste in your command (the Comment is optional) Click the Add button. Note for newer versions of Ubuntu You can find this application by searching for "Startup Applications" in ...


5

There are two files controlling X startup in a standard Ubuntu installation: /etc/init/gdm.conf and /etc/init/failsafe-x.conf. While the first is owned by package gdm, the second is owned by x11-common and will be triggered if GDM fails to start, which happens in particular when you remove GDM. However, you need not remove packages to prevent GDM from ...


5

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


4

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 ...


4

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, ...



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