systemd is systemv times one hundred!
See all
Members (2,996)
Harald Hoyer's profile photo
Michal Sekletár's profile photo
Kay Sievers'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
Donal Cahill's profile photo
Raphael Ludwig's profile photo
Bård Aase's profile photo
John Kwan's profile photo
John Salvatore Fontanelli's profile photo
Reiner Bühl's profile photo
Tony Nie's profile photo
Andy Webster's profile photo
Chester Moy's profile photo
Gabriel G's profile photo
Dhaval Giani's profile photo
Bernd Mueller (IanG)'s profile photo
Max N. Boyarov (zotrix)'s profile photo
Jean Jacques's profile photo
Anton “tony” Bangratz's profile photo
Dmitry Zinushin's profile photo

Stream

Join this community to post or 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...
 
I am doing some experimenting on creating services. While doing so I created a dummy daemon in C that does not work within systemd as long it contains a while loop. The daemon is running if I start it manually in a shell but on systemd it does nothing if it "runs".

You can see the source of the daemon here: http://pastebin.ubuntu.com/14688995/

The daemon has been compiled using gcc -o foo foo.c -lsystemd and uses the service file you can take a look here: http://pastebin.ubuntu.com/14689021/

Can anyone tell me what is going wrong here? Since this daemon is a rather stupid minimal example I was expecting it to just work.
Ubuntu Pastebin. Paste from tvn at Thu, 28 Jan 2016 16:11:11 +0000. Download as text. 1 2 3 4 5 6 7 8 9 10 11 12. #include #include #include int main(){ printf ("Booting up...\n"); while (true) { sleep (1); printf ("Tick\n"); } return 0; }. Download as text.
1
Andreas Henriksson's profile photoTheodor van Nahl's profile photo
4 comments
 
While writing an answer I tested a few things and now everything works as I expected it to work -- with the code and .service mentioned in my post. Maybe I just forgot to do a systemctl --user daemon-reload for a longer period or there has been something else I cannot figure out anymore. Thank you both for your support! The checklist in man 7 daemon will help me a lot while experimenting further on.
Add a comment...
 
Hi!

Is there a way to get the path of a signal with sd-bus?
I added the match with
sd_bus_add_match(), and i'm correctly receiving signals; but once i received the signal, i need to be able to get its path.

Thanks!

1
Federico Di Pierro's profile photo
 
Aaaand once more, i should wait more time before posting.
Sd_bus_message_get_path() should do the trick (i'm not able to test yet but i'm pretty sure it's the right function)!

Edit: yes, it is!
Add a comment...
 
Hi!
I'm trying to get an udisks2 property through sd-bus.
I'm stuck: i cannot understand how to properly retrieve the reply message.
http://codepad.org/xVhgxoxT

It is crashing on
"r = sd_bus_message_read(mess, "ay", &bytes);" .

Note that "&bytes" is just one of the solutions i tried, and i really have no more clues.
My purpose is to copy the bytes array as string in "s".

Obj_path is correct, as i printed and checked it (in fact the "sd_bus_get_property" call won't fail).

Any idea?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33. static void iso_backing_file(char *s, const char *name) { sd_bus_error error = SD_BUS_ERROR_NULL; sd_bus_message *mess = NULL; sd_bus *iso_bus = NULL; char obj_path[PATH_MAX + 1] ...
1
Federico Di Pierro's profile photo
 
http://lists.freedesktop.org/archives/systemd-commits/2013-October/004569.html
found here a working example, my code now looks this way: http://codepad.org/0zYgrYxX. It's working fine.
Add a comment...
 
Just an announcement. I've started work on a couple of system components (PAM module, systemd-controlled service, GDM greeter) that all together allow you to authenticate using the fingerprint scanner on your phone.

Currently this will probably only work with the Nexus 5X and 6P, which I have both here for testing (requires a small app on the Android side as well), but should work with any phone running Marshmallow or higher with a fingerprint scanner.

Goals are security and ease of use, in that strict order.

If anyone is interested in contributing in any way please feel free to contact me. Thanks for reading. 
3
Add a comment...

Charles Hymes

Discussion  - 
 
How to simulate shutdown to debug systemd unit?
I am trying to edit a config file to shutdown virtualbox guests when the host is shutting down. Stopping  must happen very early in the shutdown sequence, before any other services are stopped. It must also block other services from stopping, until this service is stopped. Trial and error on this is slow and painful. Is there a way to see the shutdown sequence without actually shutting down the host? Here is my config file:

[Unit]
Description=Start and correctly stop virtual guests
Requires=vboxdrv.service
Wants=local-fs.target network.target cryptsetup.target named-chroot.service vboxdrv.service
After=local-fs.target network.target cryptsetup.target named-chroot.service vboxdrv.service
Before=smb.service nmb.service winbind.service

[Service]
ExecStart=/usr/lib/virtualbox/VBoxAutostart --background --start --config /etc/vbox/virtualbox.cfg
ExecStop=/bin/sudo /sbin/wait4poweroff --quiet
RemainAfterExit=true
TimeoutStopSec=400
KillMode=none
User=vmadmin
#StandardOutput=journal
#StandardError=journal

[Install]
WantedBy=multi-user.target
1
Charles Hymes's profile photoEnaut Waldmeier's profile photo
4 comments
 
Well I think the solution might be to add requires dependencies in your service to all the filesystems it needs.

But it is only a guess I havn't actually written any service files dependent on filesystems. you could try asking on the mailinglist or on irc where the real pros live...
Add a comment...

Lindskog Work

Discussion  - 
7
Add a comment...

Harald Hoyer
moderator

Discussion  - 
 
 
It’s pretty easy to see what error messages have been logged on a machine with systemd installed: just run journalctl -p err. But this will show you all of the messages of priority “err…
8
Add a comment...

Dnk Dnk

Discussion  - 
 
Where is the best spot to get help with writing systemd scripts? I'm having my first crack at it, but I'm hitting some issues.
1
Dnk Dnk's profile photoarnaud gaboury (gabx)'s profile photo
5 comments
 
+Dnk Dnk I may help you but please post your service files and how you start the service. I understand these are user services, right?
Add a comment...

Jacob Keller

Discussion  - 
 
A gotcha for those used to cloning Linux virtual machines when using systemd.

If you clone the image using just a simple disk-copy, it is possible that an already created /etc/machine-id will be copied to the clone, and all machines created from the same source will thus have an identical machine-id. This /etc/machine-id file is used as the source for various persistent but random things, such as persistently generated MAC addresses for virtual network devices.

It's pretty reasonable to have assumed in the past that you knew all of the bits to change when doing a disk copy clone, but today I think it would be recommended to use something like an installer kickstart file or similar to help avoid these issues.

Otherwise, you may be left (like I was) wondering why your MAC addresses on virtual functions were not as random as they were supposed to be.
2
Duncan Innes's profile photoJacob Keller's profile photo
6 comments
 
I think it makes sense as an extension of the systemd first boot program
Add a comment...

About this community

A community for all things +systemd

Michael Heyns

Discussion  - 
 
I would like a file based filesystem to be mounted using a user .mount unit. But it fails with: mount: only root can do that

I am able to mount manually as the normal user.

Any advice?
1
Colin Guthrie's profile photoMichael Heyns's profile photo
5 comments
 
+Noah Friedman unfortunately no selinux available on this kernel.

+Colin Guthrie​ Thanks for the insight. Do you think it is worth opening an issue on github? Maybe I should consult the mailing list.
Add a comment...

Ani Banerjee

Discussion  - 
 
Hi,
Can anyone  help me with a networking issue please. I am assigning a dedicated interface to the container via "--network-interface=eth1". Now how do I set a static ip for the container? Do I need systemd-network configured? Cheers!
1
Add a comment...

Ahmed Kamal

Discussion  - 
 
Securing #centos 7 server with yum-cron (awesome) .. Sad there's no way to restart svcs/kernel when it makes sense. Any #systemd magic ? +Lennart Poettering ;)


1
Michael Chapman's profile photo
9 comments
 
I should add that the idea of automatically restarting services just because their libraries got updated is pretty bonkers anyway.

What happens if a very low-level library gets updated, like glibc? Should every service be restarted? If not, are you now going to have to maintain some kind of blacklist so that only "safe" libraries trigger a restart?

What about processes that aren't associated with services, like things in people's login sessions?

And finally, the sort of search that needs-restarting and similar tools do is pretty naive. They simply look around for processes that seem to have library files open that are no longer present in the filesystem (i.e. have been replaced with a newer version). But that really only works with load-time-linked shared object libraries -- it doesn't help software that dynamically loads and unloads libraries at runtime, or software written in scripting languages that don't keep their library files open all the time.

There's a reason why needs-restarting (and similarly the "tracker" plugin for DNF) simply report the list of processes that might need restarting and leave it up to the sysadmin to decide what to do.
Add a comment...

Jonathan Kang

Discussion  - 
 
Does sd_journal_next(journal) functions the same as sd_journal_next_skip(journal, 1)?

Thanks in advance.
1
Frederic Crozat's profile photoJonathan Kang's profile photo
2 comments
 
+Frederic Crozat Okay. Thanks for the help!
Add a comment...

百合仙子

Discussion  - 
 
Hi, can journalctl show logs in generating order instead of time order? I have a system without a battery and I need to read the latest generated logs.
1
Peter H.S.'s profile photo百合仙子's profile photo
4 comments
 
+Peter H.S. Thanks. It shows monotonic timestamps, but does not sort by them so I have to sort them myself.

And I find that on my notebook, the logs at the beginning have larger monotonic timestamps (without any other options) than at the end (-n). Has it wrapped?

PS: it's strange that there are more reboot marks in the journal of my clockless system than the times it has actually rebooted.
Add a comment...

Trigger Hunag

Discussion  - 
 
Hi, I am new to sd-bus. As sd-bus is also a new API compared with dbus-glib, I can not find too detailed information about it. And also there are not enough comments in sd-bus.h. I just come here and want to ask some questions.  Would anyone can give me more information about the parameters of SD_BUS_METHOD/SD_BUS_PROPERTY, especially the '_signature' and '_result'.  I have found some examples in systemd source code, such as SD_BUS_METHOD("PullDkr", "sssssb", "uo", method_pull_dkr, SD_BUS_VTABLE_UNPRIVILEGED), but do not understand what's meaning of "sssssb" and "uo".
Thanks in advance.
1
Trigger Hunag's profile photo
6 comments
 
+Lennart Poettering
 Hi Lennart, thanks for your kindly help.
Add a comment...

Marco Cavallini

Discussion  - 
 
May be worth reading it to increase the knowledge on this matter.
Structural and semantic deficiencies in the systemd architecture for real-world service management, a technical treatise. by V.R.. Preface and disclaimer (!) You're probably wide-eyed and gnawing at your teeth already. I was finally tempted into writing this from a Hacker News discussion on ...
6
2
Theophanis Kontogiannis's profile photoMatthew Usher's profile photo
Add a comment...
 
All of a sudden I can't `systemctl hibernate` as a user, without sudo.. What happened and how do I fix it?
1
Michael Chapman's profile photoHenrique Sant'Anna's profile photo
7 comments
 
Same problem here, can't "systemctl hibernate" nor "systemctl suspend".
Add a comment...

Brian May

Discussion  - 
 
How do I debug timeout errors during boot starting dev-sdc1.device? Filesystem is btrfs. Timeout is 90 seconds, "time mount -a" returns in 1.985 seconds. I tried asking on local LUV mailing list, however only advice I got was to increase the timeout - I can't understand why it should take anywhere near 90 seconds however. As well as the typical unhelpful anti-systemd stuff. If I keep rebooting eventually it works (and is practically instant). What is it doing?
1
Cristian Ciupitu's profile photoBrian May's profile photo
2 comments
 
This is Debian/stable (Jessie) using the supplied version of systemd - 215. If it is an older bug, would be nice to know what it is...
Add a comment...