Systemd is a replacement for tjhe classic init during boot.

learn more… | top users | synonyms

18
votes
1answer
25k views

How do I setup a systemd service to be started by a non root user as a user daemon?

I just finished the install and setup process of systemd on my arch-linux system (2012.09.07). I uninstalled initscripts (and removed the configuration files). What I want to do is create a service ...
17
votes
4answers
66k views

How can I run a command after boot?

I would like to run the simple shell command echo 1 > /proc/sys/kernel/sysrq at each boot, to enable the sysrq keys. When in boot should this be done, and where should I put a script to do it?
13
votes
6answers
31k views

systemctl enable differs from systemctl start, how?

I am running an Arch Linux (latest, up-to-date) box, and attempting to get MySQL to start at boot. With the systemd package installed I have systemctl available, and as such I can do things like this: ...
12
votes
2answers
11k views

How do you make a systemd service as the last service on boot?

Many years ago, we can write our startup-script into /etc/rc.local. After all system services loaded, your script will run. Now, we use systemd, we don't have rc.local anymore. Systemd starts the ...
10
votes
6answers
12k views

Start a systemd service inside chroot

With init scripts (or with openrc) I alway could run services from a different installation root. but when I run chroot /somepath/to_root /usr/bin/systemctl start someservice I got: Running in ...
9
votes
1answer
8k views

systemd - Giving my service multiple arguments

Is it possible to give my systemd service more than one argument? I'd like to execute a program with multiple arguments which have to be decided by the final user. E.g: ./program arg1 arg2 To ...
7
votes
1answer
4k views

The @ symbol and systemctl and vsftpd

I have a two part question. What is the significance of the @ symbol in systemctl scripts? How to start vsftpd in fedora 16, (which in some tutorials seems to contain an @ in it's name)? I ...
7
votes
2answers
1k views

enabled systemd unit does not start at boot

I’ve a systemd-unit on my system that is enabled. The problem is, it doesn't restart after a reboot. It depends on two other services that are both started as expected. The service is known, enabled ...
7
votes
1answer
980 views

Writing a service that depends on Xorg

I'm trying to write a user level service for redshift, and it needs to wait until Xorg is up and running. My current service file looks like this: [Unit] Description=Redshift After=graphical.target ...
7
votes
1answer
2k views

Systemd can't start script?

I have a BASH-script I want to run on start up. My system is running systemd so I created a .service file with whith what I think is the neccessary information: [Unit] Description=My Script ...
7
votes
2answers
10k views

Why does systemd hang during reboot?

1 of 10 times, systemd hangs during reboot. I don't understand the reason. What/where should I look at to fix the problem? I am using systemd v196 and cannot upgrade it to version >=198 because the ...
6
votes
3answers
11k views

How to remove systemd services

If I install a new service then decide I don’t want that application anymore and delete it, the service is still listed in the output from systemctl as error. Where is this coming from and how can I ...
6
votes
2answers
12k views

Arch Linux - Cannot start CUPS service with systemd

In order to get printing working in Arch Linux, I installed cups, cups-filters, and hplilp (ghostscript and gs-fonts were already installed). However, when I try and make the CUPS service run on ...
6
votes
1answer
882 views

How to automount ntfs partation on raid0 in arch linux with systemd

Recently, I switched from initscript to systemd followed this wiki, and I got error like this during boot: Job dev-md126p5.device/start timed out This is my fstab: /dev/mapper/VGLinux-lvroot / ...
5
votes
1answer
2k views

add multiple static ip addresses to a server with systemd-networkd

We have a server with multiple IP adresses. Lately we migrated to systemd and we still need mutliple IPs on that server. With systemd-networkd we have some trouble finding a configuration example. so ...
5
votes
2answers
2k views

How to debug old initd script under systemd?

I have an older initd script to start my application. It worked fine under older versions of SuSE, but fails on Open SuSE 12.3. The strange thing is cd /etc/init.d ; ./script start works fine. ...
4
votes
1answer
1k views

How to write a systemd service that depends on a device being present?

I would like to write a systemd service that depends on USB WiFi dongle being present. It doesn't need to start when device is plugged in as long as it doesn't start when device is not plugged in. How ...
4
votes
1answer
506 views

systemd: ignore accidental power button pressses

On my laptop (Acer C720P) the power button is a regular keyboard key that I accidentally press all the time. This shuts down my computer instantly. Following somebody's advice, I disabled the power ...
4
votes
1answer
1k views

PM: Hibernation image not present or could not be loaded

After hibernating with systemctl hibernate, the system boots normally as if it had been shutdown. I have the resume parameter in the kernel line and the resume hook in mkinitcpio.conf These are the ...
4
votes
1answer
469 views

Passing udev environment variables to systemd service execution

I am migrating an existing udev rule that bound to the change action of a block device and runs a given script. SUBSYSTEM=="block", ENV{DEVNAME}=="/dev/sr0", ACTION=="change", ...
4
votes
1answer
1k views

Using systemd to execute an interactive (whiptail) script after multi-user.target but before the login screen

I am trying to run a small interactive configuration script from systemd on Fedora 19. It has to be run as root, and run prior to the user logging in. I have created a service which looks a bit like ...
3
votes
3answers
6k views

How to start python program at boot on Arch Linux ARM?

I am running Arch Linux ARM on my Raspberry Pi, and I need to start a python (which should keep running until it either crashes or the machine loses power) program at boot with no input at all from ...
3
votes
1answer
415 views

How does systemctl schedule system shutdown?

When I type shutdown -h +30, Linux somehow schedules runlevel's change within 30 minutes. On Debian, /sbin/shutdown is symbolic link to /bin/systemctl. My tests indicate that shutdown does not use ...
3
votes
1answer
1k views

HAProxy works fine ran manually, but as a Systemd-service fails to load SSL pem-file

I'm trying to set up SSL on a Fedora 22 -server running HAProxy. Here's the config (/etc/haproxy/haproxy.cfg): global log 127.0.0.1 local2 chroot /var/lib/haproxy pidfile ...
3
votes
1answer
947 views

How to debug old init.d script under systemd?

I can't get any output from the script. systemd just prints: sinopia.service: control process exited, code=exited status=203 Failed to start LSB: starts the sinopia web server. I can't even launch ...
3
votes
1answer
2k views

Start celery daemon via systemd

In the /usr/lib/systemd/system/celery.service: [Unit] Description=Celery Nodes Daemon After=network.target [Service] Type=forking PIDFile=/var/run/celery/main.pid ExecStart=/usr/bin/python2 ...
3
votes
1answer
805 views

How to stop a group of systemd custom services

I wrote three service units, say a.service b.service and c.service. C requires and runs after b, b requires and runs after a, so when I execute "systemctl start c.service", all three of them will be ...
3
votes
1answer
36 views

stopping a systemd service when starting another

I have written a simple zram.service file that will set up compressed swap space for me to avoid chewing too much om my disks. The zram have higher priority than the other swap devices. The problem ...
3
votes
1answer
1k views

Systemd-networkd: How can I prepend a static nameserver entry to DHCP-discovered nameservers?

I'm using systemd 213 on Arch Linux, and systemd-networkd/resolved with DHCP to connect to the internet. I'm also running a caching DNS server on 127.0.0.1. I'd like to make this server the first DNS ...
3
votes
1answer
3k views

Run script at shutdown/reboot with systemd

I would like to run a script file when the system is called for shutdown/ reboot from 'reboot' and 'shutdown' commands. And if possible, also hard shutdowns like 'init 0' or 'poweroff'. How would I go ...
3
votes
1answer
46 views

How to encrypt a live rootfs on Arch Linux

I have a Linux Arch system running on a VPS. The rootfs is installed on a LVM partition. I would like to overlay an encrypted container on this partition, then reinstall the rootfs on it and enable ...
3
votes
0answers
112 views

How to start a systemd service after user login and stop it before user logout

I have a Fedora 23 Machine. I have a directory/file synchronizing bash script that synchronizes my local /home directory to a remote directory (in a NAS machine). I run it manually but I would like ...
3
votes
0answers
763 views

How do I figure out why systemctl service “systemd-modules-load” fails?

For some time I've seen some red text flashing by during boot. Today I decided to look into it. The systemctl service systemd-modules-load.service is failing with this text: tomas@bonus-debian:~$ ...
3
votes
0answers
77 views

RequiresMountsFor not working on Debian 8

I am trying to set up a systemd service on Debian 8 to run a program from the network on startup but it does not work - the service starts before mounting NFS disks have completed. I have the ...
3
votes
2answers
1k views

Automatically unlock LUKS partition using a key on an USB drive on Debian Jessie

I am trying to have the encrypted root partition be unlocked on boot automatically using a connected USB drive on a fresh installation of Debian Jessie (no non-systemd upgrade). After following a ...
2
votes
3answers
6k views

Arch Linux Install Cannot Enable dhcpd

I am trying to setup internet with arch linux. I just installed it using parallels and got the following error: [root@singularity ~]# systemctl enable dhcpd.service Failed to issue method call: No ...
2
votes
2answers
2k views

At what point are cgroups initialized for systemd?

So to cut a long story short, I am trying to get systemd working with an Arch install, but without running systemd from init. This means I am booting into a system that is not running systemd, then ...
2
votes
1answer
2k views

Debian not reboot or shutdown

I'm truck with a simple problem of rebooting with my installation of Debian 7. I got inspire by this issue but it's not working. I tried a lot of combinations but still nothing. I'm not sure about ...
2
votes
1answer
504 views

Installing a systemd service from an RPM?

I've been creating RPMS (using CMake's CPack) which install everything into /opt, and then the postinstall script copies the service definition files to /etc/systemd/system. I've toyed around with ...
2
votes
1answer
426 views

systemd: decrypt luks device on access

I have an external drive with a LUKS-encrypted partition. As the device is an external USB device and I don't always need it, I only want to decrypt and automount on demand. I can easily automount the ...
2
votes
1answer
4k views

How does docker-tcp.socket actually enable Docker's remote API on CoreOS?

I'm reading through the systemd configurations for Docker on CoreOS trying to figure out how the TCP port for Docker (port 2375) gets enabled. When I look at the docker.service configuration file, I ...
2
votes
2answers
854 views

Why does systemd process stop as soon as it starts for foreman server process?

I am trying to export a simple Ruby app using foreman. Based on its usage for systemd, I appear to be doing things correctly. However, when I start the target/service, I get status messages along the ...
2
votes
1answer
19 views

Identify the systemd unit file from process name

For some service unit files, the unit file name does not correspond to the name of the daemon. For example Postfix: The unit file is called postfix.service but the underlying daemons launched are ...
2
votes
0answers
384 views

How do i make systemd-networkd ignore DHCP pushed default route?

I want systemd-networkd ignore the default route/s pushed by DHCP on one interface. My work setup has 3 network interfaces. I have one .network file for each interface: eth0) internet [Match] ...
2
votes
1answer
426 views

How do I run a script before everything else on shutdown with systemd?

Note: Briefly formulated question can be found at the bottom. I have a script which makes a backup of my files onto an external USB drive. Executing it can take a while, depending on the amount of ...
2
votes
0answers
109 views

systemd: Start service/script IMMEDIATELY after mount

On a system running Debian 8 with Systemd, I am trying to run a service immediately after /var is mounted. The custom service copies some essential files to /var, and it must be run before any other ...
2
votes
0answers
52 views

systemd - get dropbear to only look at openvpn interface

I am trying to configure dropbear to do the following. 1) Only listen on port 22 of the tun0 interface (made by openvpn service). 2) Only use public key authorization. I see that dropbear.socket is ...
2
votes
0answers
145 views

Preferred/Idiomatic method to enable a systemd.service from a Debian package installation

I have a custom Debian package I've built for our software that creates a systemd service. What is the preferred/idiomatic way to have the installation of said package enable/start the service at ...
2
votes
1answer
826 views

systemd-networkd does not enslave interfaces on bond

I have installed systemd-210 on a server and i want to create a bond for 4 interfaces. Therefore i created a 'catch-all' .network file: /etc/systemd/networkd/10.all-interfaces-to-bond0: [Match] ...
2
votes
0answers
761 views

How to know which file or inode triggered a systemd.path unit?

Systemd offers unit files whom control monitoring of a certain path trough inotify: systemd.path(5). If a file or directory is modified in the watched path the corresponding systemd.service(5) is ...