Re: [systemd-devel] not able to access system service from session service

2018-08-20 Thread deepan muthusamy
Hi,
Thank you for the reply. Since I can't use session service to access system
service, how can I start a application as service having session dbus as
system service?

On Tue, 21 Aug 2018, 5:22 am , 
wrote:

> Send systemd-devel mailing list submissions to
> systemd-devel@lists.freedesktop.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
> or, via email, send a message with subject or body 'help' to
> systemd-devel-requ...@lists.freedesktop.org
>
> You can reach the person managing the list at
> systemd-devel-ow...@lists.freedesktop.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of systemd-devel digest..."
>
>
> Today's Topics:
>
>1.  Enforcing journald diskspace limit. (Frédéric HILPERT)
>2.  Not able to access system device from session service
>   (deepan muthusamy)
>3. Re:  Not able to access system device from session service
>   (Silvio Knizek)
>4.  systemd oneshot service stop on shutdown problem
>   (Radoslaw Garbacz)
>5. Re:  systemd oneshot service stop on shutdown problem
>   (Filipe Brandenburger)
>6. Re:  systemd oneshot service stop on shutdown problem
>   (Ryan Gonzalez)
>
>
> --
>
> Message: 1
> Date: Mon, 20 Aug 2018 14:08:49 +0200
> From: Frédéric HILPERT 
> To: systemd-devel@lists.freedesktop.org
> Subject: [systemd-devel] Enforcing journald diskspace limit.
> Message-ID: 
> Content-Type: text/plain; charset=utf-8; format=flowed
>
> Hi,
>
> I have a question about systemd. Not wanting to create an issue on
> githbub because there are already plenty and this may not be a bug.
>
> I have a 1GB /var/log/ partition (on a stock Centos 7) and set
> SystemMaxUse=150M in journald configuration. When I restart journald I
> have this message :
>
> /systemd-journal[53564]: Permanent journal is using 8.0M (max allowed
> 101.4M, trying to leave 152.1M free of 501.0M available → current limit
> 101.4M).//
> /
> Everything looks fine here, but a few days later :
> /
> //MyServer# journalctl --disk-usage //
> //Archived and active journals take up 232.8M on disk.//
> //MyServer# du -sh /var/log/journal///
> //185M/var/log/journal//
>
> --> Am I missing something in order to enforce journal not use more than
> 150 (or 101.4)MB ?
>
> Regards,
> Frédéric HILPERT
>
>
>
>
> --
>
> Message: 2
> Date: Mon, 20 Aug 2018 19:22:09 +0530
> From: deepan muthusamy 
> To: Systemd ,
> d...@lists.freedesktop.org
> Subject: [systemd-devel] Not able to access system device from session
> service
> Message-ID:
>  2jyenr...@mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> I started one application as system service in /etc/systemd/system by
> giving command "systemctl  start mysystem.service".
> I have one more application which i have to start as session service in
> etc/systemd/user by giving command "systemctl --user start
> mysession.service".
>
> My session.service  has dependency on mysystem.service, so I mentioned in
> Requires and After command in session.service.
>
> But when iam trying to session.service it is showing "mysystem.service" not
> found. Can anyone help me with this?
> -- next part --
> An HTML attachment was scrubbed...
> URL: <
> https://lists.freedesktop.org/archives/systemd-devel/attachments/20180820/41e5b22f/attachment-0001.html
> >
>
> --
>
> Message: 3
> Date: Mon, 20 Aug 2018 15:57:28 +0200
> From: Silvio Knizek 
> To: systemd-devel@lists.freedesktop.org
> Subject: Re: [systemd-devel] Not able to access system device from
> session service
> Message-ID: <9064a335891804c359801498667c1dd603a8cf43.ca...@gmx.net>
> Content-Type: text/plain; charset="UTF-8"
>
> Am Montag, den 20.08.2018, 19:22 +0530 schrieb deepan muthusamy:
> > I started one application as system service in /etc/systemd/system by
> > giving command "systemctl  start mysystem.service".
> > I have one more application which i have to start as session service
> > in etc/systemd/user by giving command "systemctl --user start
> > mysession.service".
> >
> > My session.service  has dependency on mysystem.service, so I
> > mentioned in Requires and After command in session.service.
> >
> > But when iam trying to session.service it is showing
> > &quo

Re: [systemd-devel] systemd oneshot service stop on shutdown problem

2018-08-20 Thread Ryan Gonzalez
Maybe /tmp is getting cleared or unmounted first? What happens if you put
the script somewhere else?

On Mon, Aug 20, 2018, 6:48 PM Filipe Brandenburger 
wrote:

> On Mon, Aug 20, 2018 at 4:00 PM Radoslaw Garbacz
>  wrote:
> > Could you please advise me with regard to systemd configuration for
> service type=oneshot.
> > It does not execute stop on shutdown/reboot, but works as intended when
> called manually.
>
> I can't reproduce this, it works fine for me on reboot, according to
> the journalctl logs below:
>
> $ journalctl -u xdctest
> -- Logs begin at Mon 2018-08-20 23:39:33 UTC, end at Mon 2018-08-20
> 23:43:52 UTC. --
> Aug 20 23:39:45 centos7 systemd[1]: Starting ### service test ###...
> Aug 20 23:39:45 centos7 aaa.sh[353]: BEGIN: TESTING systemd: start
> Aug 20 23:40:04 centos7 aaa.sh[353]: END:   TESTING systemd: start
> Aug 20 23:40:04 centos7 systemd[1]: Started ### service test ###.
> Aug 20 23:42:08 centos7 systemd[1]: Stopping ### service test ###...
> Aug 20 23:42:08 centos7 aaa.sh[1225]: BEGIN: TESTING systemd: stop
> Aug 20 23:42:28 centos7 aaa.sh[1225]: END:   TESTING systemd: stop
> Aug 20 23:42:28 centos7 systemd[1]: Stopped ### service test ###.
> -- Reboot --
> Aug 20 23:42:44 centos7 systemd[1]: Starting ### service test ###...
> Aug 20 23:42:44 centos7 aaa.sh[354]: BEGIN: TESTING systemd: start
> Aug 20 23:43:03 centos7 aaa.sh[354]: END:   TESTING systemd: start
> Aug 20 23:43:03 centos7 systemd[1]: Started ### service test ###.
>
> Only difference from your reported setup is that I have the aaa.sh
> script under /usr/local/bin/ and I only used
> WantedBy=multi-user.target (and not default.target), but I believe
> none of those should make a difference...
>
> Cheers,
> Filipe
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
-- 

Ryan (ライアン)
Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone else
https://refi64.com/
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] systemd oneshot service stop on shutdown problem

2018-08-20 Thread Radoslaw Garbacz
Hi,

Could you please advise me with regard to systemd configuration for service
type=oneshot.
It does not execute stop on shutdown/reboot, but works as intended when
called manually.

Online discussions indicate that the configuration below should be working.

1) service configuration:
[Unit]
Description= ### service test ###

[Service]
ExecStart=/tmp/aaa.sh start
ExecStop=/tmp/aaa.sh stop
Type=oneshot
RemainAfterExit=yes
TimeoutStopSec=100

[Install]
WantedBy=multi-user.target default.target


2) Tried also:
WantedBy=shutdown.target ...



3) # systemctl status xdctest
● xdctest.service - ### service test ###
   Loaded: loaded (/etc/systemd/system/xdctest.service; enabled; vendor
preset: disabled)
   Active: active (exited) since Mon 2018-08-20 22:43:21 UTC; 1min 13s ago
  Process: 22304 ExecStop=/tmp/aaa.sh stop (code=exited, status=0/SUCCESS)
  Process: 22407 ExecStart=/tmp/aaa.sh start (code=exited, status=0/SUCCESS)
 Main PID: 22407 (code=exited, status=0/SUCCESS)

Aug 20 22:43:01 ip-10-43-215-250.ec2.internal systemd[1]: Starting ###
service test ###...
Aug 20 22:43:01 ip-10-43-215-250.ec2.internal aaa.sh[22407]: BEGIN: TESTING
systemd: start
Aug 20 22:43:21 ip-10-43-215-250.ec2.internal aaa.sh[22407]: END:   TESTING
systemd: start
Aug 20 22:43:21 ip-10-43-215-250.ec2.internal systemd[1]: Started ###
service test ###.



4) # systemctl --version
systemd 219
+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP
+GCRYPT +GNUTLS +ACL +XZ +LZ4 -SECCOMP +BLKID +ELFUTILS +KMOD +IDN



5) OS: GNU Linux, CentOS 7


Thanks in advance,

-- 
Radoslaw Garbacz
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Not able to access system device from session service

2018-08-20 Thread Silvio Knizek
Am Montag, den 20.08.2018, 19:22 +0530 schrieb deepan muthusamy:
> I started one application as system service in /etc/systemd/system by
> giving command "systemctl  start mysystem.service".
> I have one more application which i have to start as session service
> in etc/systemd/user by giving command "systemctl --user start
> mysession.service".
> 
> My session.service  has dependency on mysystem.service, so I
> mentioned in Requires and After command in session.service.
> 
> But when iam trying to session.service it is showing
> "mysystem.service" not found. Can anyone help me with this?

Hi,

the systemd --user session don't know about the systemd --system
session (and vice versa). So you can't have dependencies among them.
They are completly seperated (except for .device and .mount units)

BR

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Not able to access system device from session service

2018-08-20 Thread deepan muthusamy
I started one application as system service in /etc/systemd/system by
giving command "systemctl  start mysystem.service".
I have one more application which i have to start as session service in
etc/systemd/user by giving command "systemctl --user start
mysession.service".

My session.service  has dependency on mysystem.service, so I mentioned in
Requires and After command in session.service.

But when iam trying to session.service it is showing "mysystem.service" not
found. Can anyone help me with this?
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Enforcing journald diskspace limit.

2018-08-20 Thread Frédéric HILPERT

Hi,

I have a question about systemd. Not wanting to create an issue on 
githbub because there are already plenty and this may not be a bug.


I have a 1GB /var/log/ partition (on a stock Centos 7) and set 
SystemMaxUse=150M in journald configuration. When I restart journald I 
have this message :


/systemd-journal[53564]: Permanent journal is using 8.0M (max allowed 
101.4M, trying to leave 152.1M free of 501.0M available → current limit 
101.4M).//

/
Everything looks fine here, but a few days later :
/
//MyServer# journalctl --disk-usage //
//Archived and active journals take up 232.8M on disk.//
//MyServer# du -sh /var/log/journal///
//185M    /var/log/journal//

--> Am I missing something in order to enforce journal not use more than 
150 (or 101.4)MB ?


Regards,
Frédéric HILPERT


___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel