Re: [systemd-devel] Is it possible to load unit files from paths other than default paths ?

2016-09-22 Thread Mantas Mikulėnas
On Thu, Sep 22, 2016 at 9:13 AM, Raghavendra. H. R 
wrote:

> Thank you for the suggestions.
> But with this suggestion I need to run as user something like that.
>
> In normal init.d systems, we have environment variables like PATH &
> LD_LIBRARY_PATH.
> No matter where I place my new executable or library, adding that path
> into these environment variables is enough to execute or link the library.
>

Oh, sure, you still have PATH and LD_LIBRARY_PATH. But you weren't asking
about *executables*, you were asking about *service scripts*, and in normal
init.d systems you *don't* have anything like INITSCRIPT_PATH either, do
you? `service` uses /etc/init.d, the boot process uses /etc/rc[2345].d, and
that's it. Isn't it?

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


[systemd-devel] python-systemd 232 released

2016-09-22 Thread Zbigniew Jędrzejewski-Szmek
After a long while… it's here.

CHANGES WITH 232:

* Wrappers for sd_journal_enumerate_unique, has_runtime_files,
  has_peristent_files.

* sd_journal_open_directory_fd, sd_journal_open_files_fd can
  be used by passing file descriptors to the initializer as
  the path or files arguments.

  SD_JOURNAL_OS_ROOT flag is supported, and various flags may
  be passed to the constructor in combination with path or
  files arguments. All flags arguments are now passed through
  to the underlying libsystemd library functions, so which
  combinations are supported depends on that library.
  systemd 232 contains various fixes in this area.

Contributions from: Benedit Morbach, Michael Biebl,
Michael Herold, Mike Gilbert, Nir Soffer, Sebastian,
Ville Skyttä, Zbigniew Jędrzejewski-Szmek

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


[systemd-devel] systemd, cgroups and process swappiness

2016-09-22 Thread Dennis Jacobfeuerborn
Hi,
I'm trying to prevent a qemu process from using swap and noticed that in
addition to /proc/sys/vm/swappiness systemd and cgroups now play a role
in this.

I set /proc/sys/vm/swappiness to 0 and did the same for
/sys/fs/cgroup/memory/machine.slice/memory.swappiness and
/sys/fs/cgroup/memory/machine.slice//memory.swappiness yet
when i look at look at the VmSwap values for the process it still goes
up sometimes indicating that more swap space is used:

[root@virt7 machine.slice]# cat /proc/31655/status|grep VmSwap
VmSwap:  3725508 kB

I noticed that some values can be set using "systemctl set-property" but
memory.swappiness does not seem to be among them so i used "echo 0 >
..." to set the above values.

Is there something else that needs to be done to apply these values to
the running process?

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


Re: [systemd-devel] Is it possible to load unit files from paths other than default paths ?

2016-09-22 Thread Andrei Borzenkov
On Thu, Sep 22, 2016 at 9:18 AM, Raghavendra. H. R  wrote:
> Thank you for the suggestions.
> But with this suggestion i.e., generator file, I again need to add/modify
> some files.
>

You need to add/modify some files to implement your service anyway. I
do not see how one more file is a problem so far.

> All I'm looking into is I mount my binaries and unit files under /mnt. By
> setting any environment variable like SYSTEMD_UNIT_PATH, systemd should pick
> the unit files from /mnt and execute my binaries as per the instructions
> given in unit file.
>

Which is exactly what it does. You just need to set variable in
environment of systemd.

> In normal init.d systems, we have environment variables like PATH &
> LD_LIBRARY_PATH.
> No matter where I place my new executable or library, adding new path into
> these environment variables is enough to execute or link the library.
>
> Probably this kind of facility is not available in Systemd init systems.
>
> --
> Regards,
>
> Raghavendra. H. R
> (Raghu)
>
> On Wed, Sep 21, 2016 at 10:40 PM, Andrei Borzenkov 
> wrote:
>>
>> 21.09.2016 14:26, Raghavendra. H. R пишет:
>> > Hi,
>> >
>> > I'm newbie with systemd boot system and I need help in resolving one
>> > issue.
>> >
>> > I would like to create a service under a customized path Eg:/mnt and
>> > systemd should be able to pick my unit file from this.
>> >
>> > I tried by setting *Environment=SYSTEMD_UNIT_PATH=/mnt *from the
>> > console
>>
>> This should be set in environment of srarted systemd, which in case of
>> systemwide init effectively means either you need to use some wrapper to
>> set it and exec systemd or hack initrd.
>>
>> Also SYSTEMD_UNIT_PATH does not really play nicely with priorities of
>> unit locations (run-time vs. sysadmin vs. shipped).
>>
>> May be it is simpler to install generator that copies your unit
>> definition in standard location. This guarantees it is available before
>> systemd starts.
>
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] terminal permissions after machinectl shell

2016-09-22 Thread Michał Zegan
Hello, when you use machinectl shell, you get your own pseudoterminal,
don't you? but it is owned by root.
Problem is when some background process tries to open this terminal when
this background process runs from the spawned shell, like gpg-agent,
because it has no permissions to do so and fails.



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Is it possible to load unit files from paths other than default paths ?

2016-09-22 Thread Raghavendra. H. R
Thank you for the suggestions.
But with this suggestion I need to run as user something like that.

In normal init.d systems, we have environment variables like PATH &
LD_LIBRARY_PATH.
No matter where I place my new executable or library, adding that path into
these environment variables is enough to execute or link the library.

Probably this kind of facility is not available in Systemd init systems.


Regards,
Raghavendra H R


On Thu, Sep 22, 2016 at 12:34 AM, Kai Krakow  wrote:

> Am Wed, 21 Sep 2016 16:56:52 +0530
> schrieb "Raghavendra. H. R" :
>
> > Hi,
> >
> > I'm newbie with systemd boot system and I need help in resolving one
> > issue.
> >
> > I would like to create a service under a customized path Eg:/mnt and
> > systemd should be able to pick my unit file from this.
> >
> > I tried by setting *Environment=SYSTEMD_UNIT_PATH=/mnt *from the
> > console but it didnt help and found the error *"Failed to start
> > startup.service: Unit startup.service failed to load: No such file or
> > directory."*
> >
> >
> > Is it possible to achieve this ?
>
> Not sure if this helps you, i.e. is appropriate for your use-case...
>
> But if the directory happens to be a home directory and the services
> are designed to be run as user, you could make the service files go
> into $HOME/.config/systemd/user/ (or symlink this to your mountpoint)
> and enable linger on the user (loginctl enable-linger $USER).
>
> You can then manage these units as the user through "system --user
> {start,stop,enable,...}" (only with real login sessions, not through
> sudo -iu $USER, but ssh would work).
>
> --
> Regards,
> Kai
>
> Replies to list-only preferred.
>
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Is it possible to load unit files from paths other than default paths ?

2016-09-22 Thread Raghavendra. H. R
Thank you for the suggestions.
But with this suggestion i.e., generator file, I again need to add/modify
some files.

All I'm looking into is I mount my binaries and unit files under /mnt. By
setting any environment variable like SYSTEMD_UNIT_PATH, systemd should
pick the unit files from /mnt and execute my binaries as per the
instructions given in unit file.

In normal init.d systems, we have environment variables like PATH &
LD_LIBRARY_PATH.
No matter where I place my new executable or library, adding new path into
these environment variables is enough to execute or link the library.

Probably this kind of facility is not available in Systemd init systems.

--
Regards,

Raghavendra. H. R
(Raghu)

On Wed, Sep 21, 2016 at 10:40 PM, Andrei Borzenkov 
wrote:

> 21.09.2016 14:26, Raghavendra. H. R пишет:
> > Hi,
> >
> > I'm newbie with systemd boot system and I need help in resolving one
> issue.
> >
> > I would like to create a service under a customized path Eg:/mnt and
> > systemd should be able to pick my unit file from this.
> >
> > I tried by setting *Environment=SYSTEMD_UNIT_PATH=/mnt *from the
> > console
>
> This should be set in environment of srarted systemd, which in case of
> systemwide init effectively means either you need to use some wrapper to
> set it and exec systemd or hack initrd.
>
> Also SYSTEMD_UNIT_PATH does not really play nicely with priorities of
> unit locations (run-time vs. sysadmin vs. shipped).
>
> May be it is simpler to install generator that copies your unit
> definition in standard location. This guarantees it is available before
> systemd starts.
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel