Hot answers tagged

18

As others have noted, the answer is all about runlevels which are basically the modes of operation of an operating system. On Linux, these are usually: ID Name Description 0 Halt Shuts down the system. 1 Single-user Mode Mode for administrative tasks. 2 Multi-user Mode ...


17

Look in your conf file /etc/php5/fpm/pool.d/www.conf. There you will find options user and group. It will appear as [www]. You can make it into [myuser] group=mygroup.


17

What immediately comes to mind is an underprivileged user being able to run things on boot as root, which is desirable to crackers that: Want to escalate privileges of other accounts Want to use your server to host a rogue service Want to start IRC/Spam bots if the server reboots Want to ping a mother ship to say "I'm up again" and perhaps download a new ...


17

chaos' answer is what some doco says. But it's not what systemd actually does. (It's not what System V rc did, either. Linux System V rc most definitely did not ignore LSB headers, which insserv used to calculate static orderings, for starters.) The Freedesktop doco, such as that "Incompatibilities" page, is in fact wrong, on these and other points. ...


15

A background-job (ie. started with &) still has it's stdin, stdout and stderr connected to the terminal it was started in. It may suddenly write (eg. error-messages) to the terminal ("disturbing" the job in the foreground) or pause waiting for input from the keyboard (you must first put it in the foreground). You may of course redirect stdout and ...


10

These are runlevels and are a System V-style initiation used by most *NIX systems (with the notable exception of systemd-based systems). When booting the kernel/user decides what runlevel should it run and execute only that runlevel. Meaning that depending the runlevel you can boot up with a different set of programs. There are runlevels for halt and reboot ...


10

It looks like Vim is smart enough to give you a clue as to what the problem is! That's interesting. The problem is that there is no such runlevel as 7. The valid run levels are s (or S), 0, 1, 2, 3, 4, 5, and 6. According to the manpage of my copy of init there also exist also pseudo-runlevels a, b, and c though I have never heard of those before. EDIT: It ...


9

In addition to the very good points made by Tim Post, I'd add that for a setup where multiple people need to be able to push changes onto a server, you should consider using some kind of configuration management system. If you e.g. use puppet, or chef, or cfengine, you can have the relevant users edit the files locally and then push the changes out with the ...


8

Nothing. Different Linux distributions, and the LSB, had different standards, so both are present on CentOS to make it easier to run software from different versions. One is just a symbolic link to the other. http://www.centos.org/docs/5/html/5.1/Installation_Guide/s2-boot-init-shutdown-init.html gives details on the boot process, but ultimately all the ...


7

Good question. The only reference I've found to those files is in man insserv: /etc/init.d/.depend.boot, /etc/init.d/.depend.start, /etc/init.d/.depend.stop The make(1) like dependency files produced by insserv for booting, starting, and stopping with the help of startpar(8). And in fact, running just plain insserv touches ...


7

From /usr/share/vim/vim74/syntax/inittab.vim: syn match inittabRunLevels "[0-6A-Ca-cSs]\+" contained nextgroup=inittabColonAction,inittabError So yes, vim considers only 0-6, and both upper-and lowercase a b c s letters as valid runlevels.


6

If I tell my system to go to run level 3 does that mean that it first runs through run level 0, 1, 2, and then finally runs through run level 3? No, it does not. Runlevels are not consecutive in that manner. Case in point: runlevel 0 is usually the "shutdown" runlevel, which stops all services and eventually halts (and possibly powers off) the system. ...


6

/etc/init.d scripts are non-interactive, non-login, and they don't try to access an X session because they are system wide services.1 System services aren't associated with any particular logged in user,2 but an X session always belongs to a logged in user. If your application needs a GUI context to work, it shouldn't be a system service. You have not ...


6

init.d, also known as SysV script, is meant to start and stop services during system initialization and shutdown. (/etc/init.d/ scripts are also run on systemd enabled systems for compatibility). The script is executed during the boot and shutdown (by default). The script should be an init.d script, not just a script . It should support start and stop and ...


5

(open)SUSE uses /etc/init.d/after.local for this purpose. Just add the commands you need to be executed into that file. Note that this works fine with SystemV init, but with systemd this would need AFAIK need to be solved differently.


5

What invoke-rc.d does is documented in its man page. It is a wrapper around running the init script directly, but it also applies a policy that may cause the command not to be run, based on the current runlevel and whether the daemon should be run in that runlevel. By default, Debian does not differentiate between runlevels 2-5, but as the local ...


5

Newer syntax for Suse Linux Enterprise 11 SP2 (and openSUSE ?) The best way would be to create a shell script that will call your PHP script. This shell script should have in its header the following comment: #!/bin/sh ### BEGIN INIT INFO # Provides: nothing # Required-Start: $all # Default-Start: 3 5 # Default-Stop: 4 # ...


5

You don't have to run abrtd, no. As per man abrtd: abrtd is a daemon that watches for application crashes. When a crash occurs, it collects the problem data (core file, application’s command line etc.) and takes action according to the type of application that crashed and according to the configuration in the abrt.conf config file. The default ...


5

I know modprobe can be used to load modules, but how does it decide which modules to load? When the kernel needs a feature that is not resident in the kernel, the kernel module daemon kmod1 execs modprobe to load the module in. modprobe is passed a string in one of two forms. A module name like softdog or ppp. A more generic identifier like ...


5

The directory, /etc/init.d/ contains system scripts that essentially start, stop, restart daemons (system services). It's the "System V Initialization" method (SysVinit), containing the init program (the first process that is run when the kernel has finished loading). (EDIT 2 July 2015: Many Linux systems have recently switched to the systemd init system.) ...


5

Try (as root):- systemctl disable graphical.target After a restart, you should be in multi-user mode as opposed to graphical. If that fails, check what your default target is with:- ls -l /lib/systemd/system/default.target # or, depending on your distro ls -l /etc/systemd/system/default.target Note that the only difference in the paths is the top ...


5

systemctl disable doesn't work if the source is an init.d script. What should I do instead to disable lightdm starting at boot? Ironically, neither of the "official" ways of doing this have been mentioned in any answer so far. So for completeness, here they are: You "mask" the service: systemctl mask lightdm.service Or you create a unit file of ...


5

init files, which run at system boot (or on demand) do two main things: they start daemons running they do various one-time-per-boot tasks, such as cleaning up or preparing files, setting network parameters, etc. In this case, the sudo init script does not start a daemon. Instead, it invalidates any cached credential files that may have been left around ...


5

The hyphen (-) found in an init script: #!/bin/sh # # chkconfig: - 24 73 means that the service should not be started in any run levels by default, only stopped. It replaces a list of run levels (e.g. 345) as shown below: #!/bin/sh # # chkconfig: 345 24 73 Therefore if you use: chkconfig --add <script> then no start links will be created in ...


5

And now for the Ubuntu answers. This is an Ubuntu Linux question, and version 15 is now released. The Ubuntu world now has systemd. But even before version 15 the Ubuntu world had upstart. There really isn't a reason to write System 5 rc scripts; and there is certainly no good reason for starting from there. Both upstart and systemd do all of the ...


5

There have been a number of varied boot and service control systems across Unix platforms over its tangled history. The service\chkconfig based system you found simple and effective is generally referred to as SysVinit style and was a major step along the way to some sort of standardization. You will find this style of boot on RHEL/CentOS(EL) through the 6 ...


4

For buildroot all your scripts must be placed in $path_to_buildroot/output/target/etc/init.d before build image. In my case this directory contains rcS and few scripts named S[0-99]script_name. So you can create your own start\stop script. rcS: #!/bin/sh # Start all init scripts in /etc/init.d # executing them in numerical order. # for ...


4

When you switch runlevel, the only things executed are the scripts in /etc/rc.d/rc${NEW_LEVEL}.d/. This means that you are right: Every rc*.d directory needs to be able to handle all of the process/service changes when switching from another runlevel. So every rc directory contains a full set of scripts for reaching that runlevel. Say you're switching to ...


4

Debian probably configured/patched nginx for their package to put the pid file someplace specific that it doesn't do by default. When you replaced it via something compiled from source, it doesn't match the expectations of the service infrastructure. I'd look at what patches and configuration options were done by the debian folks and recompile your 1.4.x ...


4

If your application needs an X server for some weird reason but doesn't do anything useful with it, give it a virtual X server. This is commonly done to run web browsers in automated test suites for web applications — nobody's looking at the screen but the web browser won't run without one. Xvfb creates an X server that “displays” only to memory, not to ...



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