Hot answers tagged

4

The changelog for systemd (v230) says: systemd-logind will now by default terminate user processes that are part of the user session scope unit (session-XX.scope) when the user logs out. This behavior is controlled by the KillUserProcesses= setting in logind.conf, and the previous default of "no" is now ...


4

You don't need to be root to start a user-scoped group with systemd-run: $ systemd-run --user --scope /bin/bash Running scope as unit run-23318.scope. $ sleep 999 & [1] 23369 You can see the unit: $ systemctl --user status run-23318.scope * run-23318.scope - /bin/bash Loaded: loaded (/run/user/1000/systemd/user/run-23318.scope; static; ...


3

This question is very similiar to How to run a script with systemd right before shutdown?. With the twist that you want to be sure networking is up. To cover that, add this to your service file: After=networking.service As the docs say, After= not only declares that your service is started by the networking service, it also is declaring that the ...


3

If the group is empty, you could just remove it and then run your dpkg command. Since the command itself, apparently, creates the group, after running it everything should be fine. So, first: sudo delgroup --only-if-empty systemd-journal And then sudo dpkg --configure -a Once that has run, make sure the group was recreated and, if not, create it again.


3

A quick search for [systemd users] found this answer as the first result for you: The systemd user instance is started after the first login of a user and killed after the last session of the user is closed. Sometimes it may be useful to start it right after boot, and keep the systemd user instance running after the last session closes, for ...


3

Try using systemctl --user import-environment SSH_AUTH_SOCK in a script in /etc/X11/xinit/xinitrc.d/. Check out /etc/X11/xinit/xinitrc.d/50-systemd-user.sh for reference.


2

May be you shoul try to add first start after boot, like this: [Timer] OnBootSec=15min OnUnitActiveSec=2m


2

In addition to using Environment directive in the systemd service itself as suggested in this answer, another option is the EnvironmentFile directive. Please note that I am no expert in this area (obviously, I am the author of this question); I am only summarizing to the best of my ability the Fedora Wiki. Feel free to edit/correct me. EnvironmentFile ...


2

Is installing and setting up wicd out of the question? I've used network-manager on various laptops with various wifi cards and dongles, and sometimes network-manager works fine... but when it fails, it doesn't give much information as to what might be wrong, sometimes its errors omit some necessary piece of debugging data, other times the messages are ...


2

$HOME points to the user's home directory who is running the script. Systemd services are started with root so it will likely trying to /root/theFolder/run.sh. Use absolute paths in service files. You also have the forking option set. This is needed for program that background themselves, does your script do this? Most do not and if yours does not you ...


2

The systemd-nspawn command has a --bind option that lets you "bind mount" a directory from the host filesystem into the container. If you just do --bind /path/to/dir then it will appear in that name inside the container. If you do --bind /path/to/dir:/foo then it will show up as /foo inside the container.


1

It works exactly the same, except that systemd's init binary does not use inittab or the rcS scripts; instead it uses different logic to decide how to start a daemon. The kernel part of it, however, is still the same. If you want more than that, you'll have to be more specific...


1

As I understand it, to do this permanently, you simply pile all the addresses together, i.e.: Address=192.168.59.1/24 192.168.1.5/24


1

The VC is the virtual console which is also known as a virtual terminal VT. It is the full screen tty you might see before X11 launches. It has its own keymap architecture but systemd has merged the setting of X11 and VT keymaps into one command "for convenience". See commands like chvt, openvt, loadkeys and man 4 console.


1

I'm guessing you are trying too hard. The standard way to shutdown a service is send it a SIGTERM signal (polite) or a SIGKILL signal (forceful). I believe that's the default systemd behavior. So try removing all these lines from your systemd unit file: StandardInput=tty TTYPath=/dev/tty2 ExecStop=/bin/sh -c 'echo stop >/dev/tty2' There are plenty or ...


1

From man systemctl Show terse runtime status information about one or more units, followed by most recent log data from the journal. If no units are specified, show system status. If combined with --all, also show the status of all units (subject to limitations specified with -t). If a PID is passed, show information about the unit ...


1

To start off, using debconf in a standalone program feels wrong. To quote man debconf-devel, section OTHER SCRIPTS: You can also use debconf in other, standalone programs. The issue to watch out for here is that debconf is not intended to be, and must not be used as a registry. This is unix after all, and programs are ...


1

So, I finally found the problem, I'll post it in case it is helpful for somebody in the future. As I said, I was trying to start a service from the postinst script, and said service was trying to use debconfig to fetch some configuration parameters, but there was an error with debconf since there was already once instance running (although all the ...


1

On a system running Debian Jessie, I was able to append the following code to the file located at /lib/systemd/system/networking.service.d/network-pre.conf [Service] TimeoutStartSec=15 This changed 'no limit' to a limit of 15 seconds, making the system boot much faster if network is disconnected. Creating a file in /etc/systemd/system/networking.service....


1

Often differences between running a script manually and running it via systemd are due differences in the environment. Before the xdg-open call, add the command env on it's own line, which dumps the environment. Now run the test manually and via systemd. Look for other variables besides DISPLAY that could be causing the difference. By continuing to add ...


1

An answer to this question is to swap User=nobody not with User=ziga but with User=root in /etc/systemd/system/battery.service. Somehow even if user ziga has all the privileges of using sudo command it can't execute systemctl hibernate inside of the bash script. I really don't know why this happens. So the working files are as follows: /etc/systemd/system/...



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