Tag Info

Hot answers tagged

33

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


28

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


26

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


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


16

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


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


10

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


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.


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

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


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

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


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


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

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

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

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


5

systemd provides systemd-tmpfiles for this exact purpose. The systemd-tmpfiles service handles the creation, cleaning and removal of volatile and temporary files and directories which usually reside in directories such as /run or /tmp. The configuration of systemd-tmpfiles is described in the manual page of tmpfiles.d1. Create a systemd-tmpfiles ...


5

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


5

As @Leiaz very correctly pointed out in the comments, /sbin in Arch (and by extension, Manjaro) is now a symlink to /usr/bin. This means that unless /usr is mounted, /usr/sbin/init will not exist. You therefore need to make sure that /usr is mounted by the initial ramdisk. That's what the Arch wiki quote in your OP means: If you keep /usr as a separate ...


4

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


4

Not sure if this will help because I did not see any SElinux errors. But I'm posting what worked for me and the problems I encountered in the hope it helps. After installing Fedora 17 I upgrade to the latest release but did not reboot. I did log out and back in because of the updates to several gnome packages. (I did not notice that the update included ...


4

Error 13 is probably system error 13, which means permission denied. $ perror 13 OS error code 13: Permission denied A dot means the file has an SELinux context. GNU coreutils - What information is listed GNU ls uses a ‘.’ character to indicate a file with an SELinux security context, but no other alternate access method. A file with any other ...



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