Tag Info

Hot answers tagged

34

Both upstart and systemd are attempts to solve some of the problems with the limitations of the traditional SysV init system. For example, some services need to start after other services (for example, you can't mount NFS filesystems until the network is running), but the only way in SysV to handle that is to set the links in the rc#.d directory such that ...


34

There are mainly two approaches to do that: If you have to run a script, you don't convert it but rather call the script through a systemd service. Therefore you need two files: the script and the "service" file. Let's say your script is called vgaoff. Place your script in /usr/lib/systemd/scripts, make it executable. Then create a new service file in ...


27

From man 2 kill: The only signals that can be sent to process ID 1, the init process, are those for which init has explicitly installed signal handlers. This is done to assure the system is not brought down accidentally. That is, it is possible for init to do whatever it likes upon receiving SIGKILL (including exiting), but systemd's init does not ...


17

Probably everything you want to know is here on the "Debate Init System To Use" pages that the Debian project put together around making the decision of which initsystem to go with. Within that page is a separate link to each of the choices of initsystems. Debate initsystem upstart Debate initsystem systemd For a primer on Systemd this page has pretty ...


16

Saw systemd mentioned on Arch General ML today. So read up on it. The H Online as ever is a great source for Linux Technology and is where I found my place to start researching Systemd as SysV Init and Upstart alternative. However the H Online article (in this case) isn't a very useful read, the real use behind it is it gives links to the useful reads. The ...


13

There is no real need to disable "extra" TTYs as under systemd gettys are generated on demand: see man systemd-getty-generator for details. Note that, by default, this automatic spawning is done for the VTs up to VT6 only (to mimic traditonal Linux systems). As Lennart says in a blog post1: In order to make things more efficient login prompts are now ...


11

The kernel lists them by name in /sys, both separately in (e.g.) the tree of PCI devices -- although finding them there if you don't know where they are to start with is not simple -- and together via symlinks in /sys/class/net. E.g.: > ls /sys/class/net em1 lo wlp6so Another example: > ls /sys/class/net lo p6s1 wlan0 If you are not sure which is ...


8

I would start with the Systemd manual pages. They represent a comprehensive resource of the system and services. There is also the freedesktop Systemd FAQs.


8

The simplest method I know to list all of your interfaces is ifconfig -a EDIT If you're on a system where that has been made obsolete, you can use ip link show


7

Add After=mysql.service to your service file (or change it to the correct service name), e.g: [Unit] Description=Boardies Email Server Startup Script After=mysql.service [Service] ExecStart=/home/bits/EmailServer/start.email Restart=always [Install] WantedBy=multi-user.target Please note that you don't have to put your service file into ...


7

It was easier than I thought, just installing the systemd-sysv package made all the necessary changes: Breaks: sysvinit-core Description-en: system and service manager - SysV links systemd is a replacement for sysvinit. It is dependency-based and able to read the LSB init script headers in addition to parsing rcN.d links as hints. It ...


7

Two comments. First, try to mount by Label or UUID instead of device. Device names can sometimes change. Otherwise, btrfs requires brtfs device scan call before it knows about btrfs filesystems on your machine. I expected arch to handle this but somehow it didn't work until I created a service file for this and put it in ...


7

You don't typically clear the journal yourself. That is managed by systemd itself and old logs are rotated out as new data comes in. The correct thing to do would be to schedule journald to only keep as much data as you are interested in. The most usual thing to adjust is the total disk space it is allowed to take up. Once it crosses this boundry it will ...


6

The suggested solution is to run the service unit as a normal service - have a look at the [Install] section. So everything has to be thought reverse, dependencies too. Because the shutdown order is the reverse startup order. That's why the script has to be placed in ExecStop. The following solution is working for me: [Unit] Description=... [Service] ...


6

This is described in the arch wiki: Create a new service file similar to getty@.service by copying it to /etc/systemd/system/ cp /usr/lib/systemd/system/getty@.service /etc/systemd/system/autologin@.service This basically copies the already existing getty@.service to a new file autologin@.service which can be freely modifed. It is copied ...


6

See: /lib/systemd/system/systemd-tmpfiles-clean.timer: [Timer] OnBootSec=15min OnUnitActiveSec=1d This runs the corresponding .service file 15 minutes after boot and then every day while the system is up. If you reboot multiple times in the same day, you can just have the backup script check the mtime of the archive and skip that run if it's less than a ...


6

They use insserv by default, which still requires the sysvinit package as of Debian 6.0 (Squeeze). It was originally developed and used in OpenSUSE. Links to discussions and reasons for the change to insserv can be found on the Debian Wiki. There has been much debate over the future of init systems in Debian. The main reason that Debian has not moved on to ...


6

"Closing" a TTY If systemd is not the init being used then this will not help you. sysvinit is no longer supported by Arch Linux systemd's systemctl is used to control all the service units on the system. To learn more about it reference man systemd.unit. Stopping the getty service on the desired tty will perform the task in question. Below is the ...


6

You can use systemd timers to execute script a minute after boot. First, create service file (/etc/systemd/system/myscript.service): [Unit] Description=MyScript [Service] Type=simple ExecStart=/usr/local/bin/myscript Then create timer (/etc/systemd/system/myscript.timer): [Unit] Description=Runs myscript every hour [Timer] # Time to wait after booting ...


6

The man page for systemd has the info that you're looking for. excerpt systemd provides a dependency system between various entities called "units". Units encapsulate various objects that are relevant for system boot-up and maintenance. The majority of units are configured in unit configuration files, whose syntax and basic set of options is ...


6

The message comes from src/core/manager.c in the systemd sources. It is hardcoded to use INFO system logging level. By default systemd logs messages that have INFO level, if you can change that by changing /etc/systemd/system.conf to: LogLevel=notice but you will lose quite a few of other informational messages as well. It might be best to patch ...


5

Assuming this isn't a typo, the install section in your typo service file contains a typo. It should be, multi-user.target instead of mulit-user.target (multi vs. multi), e.g: [Install] WantedBy=multi-user.target


5

From the systemd page you posted: How do I change the default runlevel? systemd uses symlinks to point to the default runlevel. You have to delete the existing symlink first before creating a new one rm /etc/systemd/system/default.target Switch to runlevel 3 by default ln -sf /lib/systemd/system/multi-user.target ...


5

The following example is inspired by this link, which actually does not mention all steps and is listed just to credit the source: http://patrakov.blogspot.com/2011/01/writing-systemd-service-files.html Step 1: I created this file (note location) which essentially fires a bash process with an extended argument. You could fire your own command which could be ...


5

The dot means there is an ACL (access control list) overriding the usual Unix permission scheme. Here's what mine looks like: $ ls -ld /tmp drwxrwxrwt. 7 root root 4096 Apr 23 22:36 /tmp $ getfacl /tmp getfacl: Removing leading '/' from absolute path names # file: tmp # owner: root # group: root # flags: --t user::rwx group::rwx other::rwx Check your ...


5

It is a bug: https://bugs.freedesktop.org/show_bug.cgi?id=54247 The only workaround, for the time being, is to use the quiet parameter in your kernel line.


5

systemd has something called 'targets' which can be thought of as the runlevels of init. prefdm.service will be run with the "default.target" which is set by default to "graphical.target". So, by setting the default target to "multi-user.target" (aka. SystemV runlevel 3) you will start all but the X11-server. Your vncserver@:[0-9].service will be unaffected ...


5

The /proc/sys/ kernel settings are manged by sysctl(8), the system defaults live in /usr/lib/sysctl.d/, overridden by /etc/sysctl.conf or /etc/sysctl.d/. They define the name of the core files and such. Not their writing (unless the kernel is configured to allow core dumps from SUID binaries). The writing is controlled by ulimit(1), i.e., ulimit -c unlimited ...


5

There are a couple of examples on the Arch Wiki systemd page. Basically, it involves creating a service file for your screen locker and ensuring it is hooked to either the suspend, hibernate or sleep targets. If you use a simple screen locker like slock, your file would look like this: [Unit] Description=Lock the screen on resume from suspend [Service] ...



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