systemd is systemv times one hundred!
See all
Members (3,176)
Harald Hoyer's profile photo
Michal Sekletár's profile photo
Lennart Poettering's profile photo
systemd's profile photo
Vincent Van der Kussen's profile photo
Glenn Holmer's profile photo
Kyungmin Park's profile photo
Bernd Mueller (IanG)'s profile photo
John Kwan's profile photo
Mauro Toffanin's profile photo
Petru-Vasile Avram's profile photo
John Salvatore Fontanelli's profile photo
Daniel Schulte's profile photo
Tony Nie's profile photo
Johan Heikkilä's profile photo
Stephan Kevenaar's profile photo
Bård Aase's profile photo
Николай Кирчев's profile photo
Darren Wise's profile photo
Jeff Hatfield (nomasteryoda)'s profile photo
Kangelezwe Mota's profile photo
Joshua Barretto's profile photo
Dhaval Giani's profile photo
Burak Sezer's profile photo

Stream

Join this community to post or comment

Darryl Bond

Discussion  - 
 
I have a mythtv backend that doubles as a desktop machine. i want to prevent anyone pressing the shutdown button from shutting down or rebooting the box.
The mythtv service runs as the user mythtv.
I have tried
Exec=/bin/systemd-inhibit /bin/mythbackend ...
in the mythbackend.service file. This does nothing and does not show in systemd-inhibit --list. I assume, because it is run as User=mythtv.

I would like to only allow shutdown/reboot if the mythbacked service is stopped.


1
Colin Guthrie's profile photoDarryl Bond's profile photo
5 comments
 
Yep, that worked. My policy now has:
polkit.addRule(function(action, subject) {
polkit.log(action.id);
if (action.id == "org.freedesktop.login1.power-off" ||
action.id == "org.freedesktop.login1.power-off-multiple-sessions" ||
action.id == "org.freedesktop.login1.power-off-ignore-inhibit" ||
action.id == "org.freedesktop.login1.reboot-ignore-inhibit" ||
action.id == "org.freedesktop.login1.reboot-multiple-sessions" ||
action.id == "org.freedesktop.login1.reboot")
return polkit.Result.NO;
});
The multiple sessions action.id was the one that fixed it but I included ignore-inhibit.
Add a comment...

Anthony Kamau

Discussion  - 
 
I'm working on a project and I've created a simple service file for:

[Unit]
Description=My Service
After=network.service

[Service]
WorkingDirectory=/opt/myservice
Environment=LOGFILE=/var/log/myservice.log
Type=forking
Restart=always
ExecStart=/opt/myservice/myserviceprocess

[Install]
WantedBy=multi-user.target

When this service is running fine, it forks a child, the child prints a message out, does some data processing and terminates when done.

After 4 connections, I expected to see 4 log lines in the log file as indicated below:

Child process 1 handling the connection...
Child process 2 handling the connection...
Child process 3 handling the connection...
Child process 4 handling the connection...

I see this instead:

Child process 1 handling the connection...
Child process 1 handling the connection...
Child process 2 handling the connection...
Child process 1 handling the connection...
Child process 2 handling the connection...
Child process 3 handling the connection...
Child process 1 handling the connection...
Child process 2 handling the connection...
Child process 3 handling the connection...
Child process 4 handling the connection...

Obviously there's something wrong somewhere **(most likely my limited understanding of systemd)** and I need to fix it as I'm getting tired of manual intervention when partition fills up - it's a small hobby server so doesn't have a large HDD!

Cheers.
1
Anthony Kamau's profile photoSimon Lindgren's profile photo
17 comments
 
Do you still have problems with every connection logging what all previous connections have logged and one more line? If so, is there a difference between what journalctl shows and what's in /var/log/myservice.log? I don't use the plaintext logging stuff in journald, so I'm stretching my knowledge a bit here...
Add a comment...

Wout Mertens

Discussion  - 
 
Is it possible to run systemd in user mode as a task scheduler?
…on a non-systemd Linux?
…on OS X?
…on Windows?

I'm asking because it would be super nice to have only one configuration for services across OSes, whether they are run by root or by a user…
1
Wout Mertens's profile photoChungy Nexen's profile photo
4 comments
 
systemd already has a --user option that runs on user sessions, it shouldn't require systemd-as-init to be running, but I don't think that scenario is tested often.

As for the other operating systems, they'll have to implement their own systemd-compatible layers.
Add a comment...
 
Is there a way to change the severity of the message sent to the syslog daemon when a unit goes into a failed state? Currently it's "warning".
1
Add a comment...

Quinn Shanahan

Discussion  - 
 
I want to add some visibility to this because it's really been frustrating me:

http://stackoverflow.com/questions/37010497/systemd-unit-is-killed-immediately-after-starting-resque

systemd is killing my service right after it starts.. but if I start it myself then systemd is able to run it too... very weird. 
3
Quinn Shanahan's profile photo
9 comments
 
christian: as I said earlier, this works with a "simple" process type and running it in the foreground, so this enforces the conclusion that the WorkingDirectory is correct
Add a comment...
 
From my talk last night for the Reliability Engineering Meetup hosted at Facebook:
9
11
Bernd Zeimetz's profile photoPetyo Vodenicharov's profile photo
Add a comment...
 
Hi there!

Will +systemd (I mean systemd-as-PID1) be related to http://www.bus1.org somehow? According to the documentation published up to now, this project will have its own PID1 binaries (org.bus1.init and org.bus1.rdinit).
Version 1. Index. Overview. org.bus1.bootstrap(7) · Git repositories. Services. org.bus1.activator(1) · org.bus1.administrator(1) · org.bus1.coredump(1) · org.bus1.devices(1) · org.bus1.init(1) · org.bus1.rdinit(1). Kernel Module ...
3
Jan Alexander Steffens (heftig)'s profile photo
 
The bus1 project is a sandbox for a couple of Red Hat engineers to experiment with and develop new technologies. AFAIK it's currently cooking a multicast messaging system (the kernel part) and an init system for IOT devices.

I would expect that successful designs will eventually find their way into systemd.
Add a comment...

Patrick Schaaf

Discussion  - 
 
Quick question: is it okay, in principle, to call something like "systemctl try-restart otherunit" from within a unit's Start script? Especially when that unit is in an After= relationship to otherunit? And that otherunit is systemd-journald? :)

I've got a unit fiddling with journald config files and then doing such a thing; that seemed to work fine with the good old systemd 208 in our openSUSE 13.1 systems, but something is getting fishy with a newer systemd (but in a very peculiar place, so it might easily be something else - concretely my unit hangs during an autoyast autoinstallation attempt with openSUSE 42.1...)
1
1
百合仙子's profile photoPatrick Schaaf's profile photoBrian Fitzgerald's profile photo
6 comments
 
+Michael Biebl thank your for the --no-block hint. I now use that, no more issues so far.
Add a comment...

Dave Gaulke

Discussion  - 
 
Is it possible to have multiple services share a mount namespace? I have attempted this with using PrivateTmp=true and JoinsNamespaceOf. Even though the services do get a shared /tmp, they do not end up in the same mount namespace. Subsequent bind mounts in one service do not show up in the other services.
2
Add a comment...

Elias Probst

Discussion  - 
 
This looks really ugly how they're trying to solve those issues and I feel systemd offers better ways to deal with the situation. Can someone spare a few minutes and help them out with a proposal for a proper solution?
 
We’ve had reports that in Kolab 16, when the system restarts, the Manticore service may be started before the MongoDB service (has become functionally apt). This would render Manticore unavailable on every system restart. This article is about how we are…
3
Jóhann B. Guðmundsson's profile photoElias Probst's profile photo
2 comments
 
+Jóhann B. Guðmundsson Alright. Thanks for your input. So it looks like they're on the right path then, planning to fix Manticore (which is a Kolab-maintained component).
Add a comment...

About this community

A community for all things +systemd

Simon Frei

Discussion  - 
 
Hi,
I am having this issue, that I have a user service that is dependent on two local mounts. Should be easily done, so I set
After=local-fs.target
I first tried with Requires as well, but that gives an error, as apparently user services cannot depend on system targets, but no error on After=. Whether this ordering is followed on boot I cannot say, as at the time I login local-fs.target is reached anyway. However on shutdown systemd starts unmounting local mounts and stopping the user script at the same time. As this user script takes its time to exit and accesses disk heavily, unmounting fails with target is busy. I expected that because of the specified After= in the user service systemd would first stop this service, then stop the services of local-fs.target.
What did I get wrong there? Any help appreciated.
Cheers,
Simon
1
Add a comment...
 
Interesting discussion: https://github.com/tmux/tmux/issues/428
With systemd 230 we switched to a default in which user processes started as part of a login session are terminated when the session exists (KillUserProcesses=yes). See https://github.com/systemd/s...
1
1
Michael Chapman's profile photoOlav Vitters's profile photoJoel Hatsch's profile photo
9 comments
 
+Michael Chapman: Somehow never saw your reply until now. Thanks for explaining!
Add a comment...

Michael Murphy

Discussion  - 
 
Systemd users might find this useful. This is an application that I've written with the Rust programming language with GTK3 as the chosen front-end of choice for managing systemd services on your desktop. It is one of my first attempts at writing a GTK3 GUI application with the Rust systems programming language.

https://github.com/mmstick/systemd-manager
systemd-manager - A systemd service manager written in Rust with the GTK-rs wrapper and direct integration with dbus
22
1
Chungy Nexen's profile photoAnthony Kamau's profile photoAlexander Lent's profile photo
3 comments
 
Michael,
As a first attempt, this is waaay more than awesome! I see a very bright future for neat looking apps on the Linux desktop from you!
Add a comment...
 
Hi all!
Is there a way with systemd to exec a command on another tty without root privileges?
Eg: i'd like to start htop on a second tty from may be a desktop file from my kde desktop.
Is this possible?

Thanks everyone!
1
Federico Di Pierro's profile photoTetja Rediske's profile photo
3 comments
 
To start? sure, but you can specify which user gets logged in and which program is started.
Add a comment...

Marko Subasic

Discussion  - 
 
I am trying to schedule a daily backup service using systemd, but with no success. I would like to do a full sync of my home directory from local SSD to local HDD during the poweroff sequence. The backup service gets started during the poweroff sequence (wanted by the powetoff.target), but the target drive gets unmounted prior to any writing, so the backup script fails. This happens most of the time, and on rare occasions, the backup service succeeds because it starts writing to HDD prior to unmounting. My question is: how can a service unit started during the poweroff sequence, prevent a mount from being unmounted during the execution of the unit? The unit file and a few more details on my setup can be found here: http://ubuntuforums.org/showthread.php?t=2317181

Any suggestions?
Thanks in Advance.
I am trying to do a backup of home directory from local SSD to local HDD on a desktop PC running Ubuntu 15.10. The idea is to perform a synchronization using rsyncrypto during the poweroff equence, because there are no file operations in home directory at that time, and I don't really care if the sync takes some time. So I created this systemd unit: Description=backup to internal HDD before shutdown Before=umount.target poweroff.target Aft...
1
Marko Subasic's profile photo
10 comments
 
+Michael Chapman Finally success! I am using ExecStop directive, as you suggested. Thu unit is started by user-1000.slice (when I log in), and it is stopped by the conflicting poweroff.target. Stopping of my unit is scheduled after stopping of local-fs.target. Full unit file with comments is here  http://ubuntuforums.org/showthread.php?t=2317181

Thanks for pointing me in the right direction. I am getting the results that I want, but please let me know if my approach is messy in any way.
Add a comment...

Steve Youngs

Discussion  - 
 
Lost colour from boot messages in v229

After updating to v229 (from v221) I'm no longer getting coloured '[ OK ]' in the boot messages. I know it still works because I do get it in the initrd portion of the boot (dracut). I also do get colour when something takes too long and has that little red horizontal scrolly asterix.

Does anyone know what might be going on? I've checked the git logs and scoured the net for clues, but so far I'm stumped. :-(
1
Add a comment...

Dirk Heinrichs

Discussion  - 
 
Hi,
1
Dirk Heinrichs's profile photoRay Strode's profile photo
12 comments
 
so doing a little reading, it seems AFS credentials are stored kernel side, and restricted to the "process authentication group" (~ session) they originate in. So systemd --user and AFS aren't a good fit for one another. glad you found an alternative way to deal with it.
Add a comment...
 
Hi,
I have a test.path running and it's in waiting state, how can I configure it to kill itself after 5 seconds of waiting ? or execute some script after 5 seconds. Tried using JobTimeout=5s, JobTimeoutAction=/home/root/somescript.sh. it didn't work.
Any suggestions ?

Thanks in Advance.
1
Jeshwanth Kumar N K's profile photopete travis's profile photo
6 comments
 
I don't think a path unit is right for you, but a udev trigger might be. Take a look at ie http://unix.stackexchange.com/questions/28548/how-to-run-custom-scripts-upon-usb-device-plug-in .
Add a comment...

百合仙子

Discussion  - 
 
I have a service A¸ and another B requires A to run. B should be stopped when A is gone, so I add to B "Requires=A.service". But then when I restart A, B fails. Maybe I should instead reload A, but A is of Type=simple and I don't know what to do for "ExecReload", as the only way to "reload" the program is to restart it.

Is there options to achieve any of these without wrapper scripts?
1. requires but doesn't fail when dependencies restart
2. a reload action actually restarts the program
1
Dave Gaulke's profile photo百合仙子's profile photo
2 comments
 
+Dave Gaulke Today I tried to reproduce this issue, but it disappeared! It seems that systemd 229 has changed its behavior. Thank you anyway.
Add a comment...
 
Hi, I use Arch Linux, I would like to run some scripts when there is any USB device mounted. I can write a script and keep looking for the output of mounts command. But, I would like to know any other possibility through systemd we can achieve this.
Example:
1. systemd.path unit file for keep monitoring for particular path.
2. something to do with systemd.device or systemd.automounter ?
3. Or can I create a unit file which can executed by systemd whenever something is got mounted ?

Thanks 
1
Daniel Rowe's profile photoGary van der Merwe's profile photo
2 comments
 
systemd will not mount USB drives automatically by default.

If you usb drives are being automatically mounted, it is most likely being done by udisks. You can monitor this by running `udisksctl monitor`.

See http://udisks.freedesktop.org/docs/latest/
Add a comment...