Re: [systemd-devel] Help writing a user service file that will exec a command upon system sleep

2015-11-02 Thread Richard Maw
On Mon, Nov 02, 2015 at 09:04:31AM +0100, Lennart Poettering wrote: > On Wed, 28.10.15 19:30, John (da_audioph...@yahoo.com) wrote: > > > I have a simple bash script that I would like to have a user service > > file run with an argument when the system enters a sleep or > > hibernation state but

Re: [systemd-devel] Help writing a user service file that will exec a command upon system sleep

2015-11-02 Thread Mantas Mikulėnas
On Mon, Nov 2, 2015 at 3:34 PM, Richard Maw wrote: > On Mon, Nov 02, 2015 at 09:04:31AM +0100, Lennart Poettering wrote: > > On Wed, 28.10.15 19:30, John (da_audioph...@yahoo.com) wrote: > > > > > I have a simple bash script that I would like to have a user service >

Re: [systemd-devel] Pulseaudio & systemd-nspawn

2015-11-02 Thread Felipe Sateler
On Mon, 02 Nov 2015 11:29:56 +0800, Kai Hendry wrote: > Hi there, > > I'm trying to have a super simple way of launching a browser in a VPN. > > I am on Archlinux with systemd 227-1 with pulseaudio 7.1-1 & I have > another Arch container configured like so: Do you have the pulseaudio server

[systemd-devel] Keeping track of usage time

2015-11-02 Thread Umut Tezduyar Lindskog
Hi, We would like to implement a feature to keep track of accumulated values of uptimes in our products. Tracked time will give us the total usage time of our product not just since last reboot (/proc/uptime). Is upstream interested in having such implementation? Umut

Re: [systemd-devel] Keeping track of usage time

2015-11-02 Thread Dimitri John Ledkov
On 2 November 2015 at 14:46, Umut Tezduyar Lindskog wrote: > Hi, > > We would like to implement a feature to keep track of accumulated > values of uptimes in our products. Tracked time will give us the total > usage time of our product not just since last reboot (/proc/uptime).

[systemd-devel] systemd-nspawn and process spawning using nsenter issue

2015-11-02 Thread Aliaksei Sheshka
Hello! I have some systemd-nspawn and namespace related question. Assume following commands, $ systemctl start c7-test #starring our container $ systemctl status c7-test #checking if it is running and looking for inside /usr/lib/systemd/systemd process $ nsenter -t 22333 -n

Re: [systemd-devel] systemd-nspawn and process spawning using nsenter issue

2015-11-02 Thread Richard Maw
On Mon, Nov 02, 2015 at 09:27:42AM -0500, Aliaksei Sheshka wrote: > Hello! > > I have some systemd-nspawn and namespace related question. > Assume following commands, > > $ systemctl start c7-test #starring our container > $ systemctl status c7-test #checking if it is running and looking for >

Re: [systemd-devel] Keeping track of usage time

2015-11-02 Thread Lennart Poettering
On Mon, 02.11.15 15:46, Umut Tezduyar Lindskog (u...@tezduyar.com) wrote: > Hi, > > We would like to implement a feature to keep track of accumulated > values of uptimes in our products. Tracked time will give us the total > usage time of our product not just since last reboot (/proc/uptime). >

Re: [systemd-devel] systemd-nspawn and process spawning using nsenter issue

2015-11-02 Thread Lennart Poettering
On Mon, 02.11.15 09:27, Aliaksei Sheshka (sheshka...@gmail.com) wrote: > Hello! > > I have some systemd-nspawn and namespace related question. > Assume following commands, > > $ systemctl start c7-test #starring our container > $ systemctl status c7-test #checking if it is running and looking

Re: [systemd-devel] journalctl's http://localhost:19531/browse

2015-11-02 Thread Lennart Poettering
On Mon, 02.11.15 18:44, Kai Hendry (hen...@webconverger.com) wrote: > On Mon, 2 Nov 2015, at 06:10 PM, Lennart Poettering wrote: > > Note that the website will show only those accessible to the > > "systemd-journal" group. > > > > Did you run "logger" unprivileged? Did you run journalctl

[systemd-devel] Run cleanup service on stop

2015-11-02 Thread Kai Hendry
Hi there guys, I have a service where it's important that it cleans up *after* it's run. In fact it's probably a good idea to make sure it's clean *before* it's run too. I got as far as: After=clean.service Requires=clean.service But that does not seem to clean on stop (say if the machine is

Re: [systemd-devel] systemd-nspawn and process spawning using nsenter issue

2015-11-02 Thread Aliaksei Sheshka
On Mon, Nov 2, 2015 at 1:05 PM, Lennart Poettering wrote: > > BTW: another way to deal with network namespaces in systemd is via > PrivateNetwork=yes and JoinsNamespaceOf=, but I am not whether that > matches what you want to do... Perhaps, I've tried [Unit]

Re: [systemd-devel] Keeping track of usage time

2015-11-02 Thread Umut Tezduyar Lindskog
journalctl --list-boots seems great actually but wouldn't work for us. We cannot keep lots of logs in our products. Ultimately we are trying to answer the question of how long one of our product has been in use. We will implement it with a .timer/.service which periodically adds /proc/uptime to

Re: [systemd-devel] journalctl's http://localhost:19531/browse

2015-11-02 Thread Kai Hendry
On Tue, 3 Nov 2015, at 02:27 AM, Lennart Poettering wrote: > Hmm, maybe there's something wrong with the ACLs on the journal files > or the directory they reside in? Normally, there should be an ACL that > allows the "systemd-journal" group access to all files, and > systemd-journal-gatewayd is

Re: [systemd-devel] journalctl's http://localhost:19531/browse

2015-11-02 Thread Kai Hendry
On Mon, 2 Nov 2015, at 07:58 PM, Colin Guthrie wrote: > I suspect that you'd probably want to hide this behind some kind of > proxy for security reasons. That proxy could add appropriate > authentication (e.g IP restrictions, user auth etc) and add in any > additional headers). > I could be wrong

Re: [systemd-devel] Help writing a user service file that will exec a command upon system sleep

2015-11-02 Thread Lennart Poettering
On Wed, 28.10.15 19:30, John (da_audioph...@yahoo.com) wrote: > I have a simple bash script that I would like to have a user service > file run with an argument when the system enters a sleep or > hibernation state but as I understand it, user service units do not > use the sleep.target. The

Re: [systemd-devel] Delete stale *.journal-files from containers

2015-11-02 Thread Lennart Poettering
On Wed, 28.10.15 14:39, Peter Paule (systemd-de...@fedux.org) wrote: > > Hi, > > I use `docker` to run containers. Each container uses `systemd` as PID 1. I > pass `-v /var/log/journal:/var/log/journal` to `docker run` to accumulate > journals on the docker host. Every time a container is

Re: [systemd-devel] journalctl's http://localhost:19531/browse

2015-11-02 Thread Lennart Poettering
On Mon, 02.11.15 13:05, Kai Hendry (hen...@webconverger.com) wrote: > Hi guys, > > Just playing around with the journalctl Web interface here: > http://s.natalian.org/2015-11-02/journalctl.mp4 > > How come messages like `logger foo` do not appear in > http://localhost:19531/browse but they do

Re: [systemd-devel] systemd-nspawn and process spawning using nsenter issue

2015-11-02 Thread Lennart Poettering
On Mon, 02.11.15 14:52, Aliaksei Sheshka (sheshka...@gmail.com) wrote: > On Mon, Nov 2, 2015 at 1:05 PM, Lennart Poettering > wrote: > > > > > > BTW: another way to deal with network namespaces in systemd is via > > PrivateNetwork=yes and JoinsNamespaceOf=, but I am not

Re: [systemd-devel] journalctl's http://localhost:19531/browse

2015-11-02 Thread Kai Hendry
On Mon, 2 Nov 2015, at 06:10 PM, Lennart Poettering wrote: > Note that the website will show only those accessible to the > "systemd-journal" group. > > Did you run "logger" unprivileged? Did you run journalctl privileged? > That might explain the difference? In that video earlier I ran

Re: [systemd-devel] journalctl's http://localhost:19531/browse

2015-11-02 Thread Colin Guthrie
Kai Hendry wrote on 02/11/15 10:44: >> > well, systemd-journal-gatewayd serves that already, you can just use >> > that... > Ah! Perfect. Oh but I need a way to setup CORS so I can access it from > my Webapp: > http://s.natalian.org/2015-11-02/systemd-journal-gatewayd.png > > Shall I file a bug?

Re: [systemd-devel] systemd-nspawn and process spawning using nsenter issue

2015-11-02 Thread Aliaksei Sheshka
> > Note that all units you join need to have PrivateNetwork=yes set if > they shall live in the same namespace. Did both your units have this set? I have my unit c7-test like that: ExecStart=/usr/bin/systemd-nspawn --quiet --keep-unit --boot --link-journal=try-guest --network-macvlan=eth0

Re: [systemd-devel] Help writing a user service file that will exec a command upon system sleep

2015-11-02 Thread Richard Maw
On Mon, Nov 02, 2015 at 04:11:14PM +0200, Mantas Mikulėnas wrote: > On Mon, Nov 2, 2015 at 3:34 PM, Richard Maw > wrote: > > > On Mon, Nov 02, 2015 at 09:04:31AM +0100, Lennart Poettering wrote: > > > On Wed, 28.10.15 19:30, John (da_audioph...@yahoo.com) wrote: > >