[systemd-devel] ?????? ?????? ?????? ?????? ?????? [systemd-d e vel] sys temctl can't execute stopactually,whenservice isstarted by other way

2017-10-31 Thread ????
Hi Lennart,
   Is there a way to get hard ulimit in systemd.unit. Because I want to set 
soft ulimit to hard ulimit value by LimitCORE.
   Thank you.




--  --
??: "Lennart Poettering"; 
: 2017??10??28??(??) 7:09
??: ""<624001...@qq.com>; 
: "Oliver Neukum"; 
"systemd-devel"; 
: Re: ?? ?? [systemd-devel] ?? ?? [systemd-d e vel] sys 
temctl can't execute stopactually,whenservice isstarted by other way



On Sa, 28.10.17 15:29,  (624001...@qq.com) wrote:

> Hi Lennart, 
> 
> 
> 'systemctl enable xxx.service' can let xxx.service be automatically
> started when host start. Can it make sure that 'systemctl stop
> xxx.service' will be executed automatically when host shutdown?

systemd keeps track of running services, and if a service is started
it is implied it is also stopped during shut down.

Lennart

-- 
Lennart Poettering, Red Hat___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Is there a way to override the "Where" option in mount units?

2017-10-31 Thread Dennis Jacobfeuerborn
Hi,
I'm trying to set up a redundant nfs server but the problem I'm
currently running into is that I need to move the
/var/lib/nfs/rpc_pipefs mountpoint outside of /var/lib/nfs.
The original mountpoint is handled by
/usr/lib/systemd/system/var-lib-nfs-rpc_pipefs.mount which comes as part
of the nfs-utils RPM.
So my initial naive idea was to create a drop-in in /etc/systemd/system
and override the "Where" option but that's when I learned that this
option cannot differ from the mount unit filename.

This creates a dilemma for me since I shouldn't modify the original
mount unit both in principle and because it would mess up things
horribly when updating. Due to the limitations on the mount unit
filename I cannot create a drop-in directory either though so I'm not
sure what the appropriate way to handle this situation is.

The only way I can think of is to disable/mask the original mount unit
and create a completely new one or is there another way to deal with this?

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


Re: [systemd-devel] Is there a way to override the "Where" option in mount units?

2017-10-31 Thread Jérémy Rosen

you could mask the original unit and symlink it with a new name in /etc

you could probably use Alias= in the [Install] section to have that 
automated at install time... not sure if that would work, some testing 
is needed.


On 31/10/2017 11:19, Dennis Jacobfeuerborn wrote:

Hi,
I'm trying to set up a redundant nfs server but the problem I'm
currently running into is that I need to move the
/var/lib/nfs/rpc_pipefs mountpoint outside of /var/lib/nfs.
The original mountpoint is handled by
/usr/lib/systemd/system/var-lib-nfs-rpc_pipefs.mount which comes as part
of the nfs-utils RPM.
So my initial naive idea was to create a drop-in in /etc/systemd/system
and override the "Where" option but that's when I learned that this
option cannot differ from the mount unit filename.

This creates a dilemma for me since I shouldn't modify the original
mount unit both in principle and because it would mess up things
horribly when updating. Due to the limitations on the mount unit
filename I cannot create a drop-in directory either though so I'm not
sure what the appropriate way to handle this situation is.

The only way I can think of is to disable/mask the original mount unit
and create a completely new one or is there another way to deal with this?

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


--
SMILE 

20 rue des Jardins
92600 Asnières-sur-Seine


*Jérémy ROSEN*
Architecte technique
Responsable de l'expertise Smile-ECS

email jeremy.ro...@smile.fr 
phone +33141402967
url http://www.smile.eu

Twitter  Facebook 
 LinkedIn 
 Github 




Découvrez l’univers Smile, rendez-vous sur smile.eu 



eco Pour la planète, n'imprimez ce mail que si c'est nécessaire
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Is there a way to override the "Where" option in mount units?

2017-10-31 Thread Dennis Jacobfeuerborn
On 31.10.2017 11:33, Jérémy Rosen wrote:
> you could mask the original unit and symlink it with a new name in /etc
> 
> you could probably use Alias= in the [Install] section to have that
> automated at install time... not sure if that would work, some testing
> is needed.
> 
> On 31/10/2017 11:19, Dennis Jacobfeuerborn wrote:
>> Hi,
>> I'm trying to set up a redundant nfs server but the problem I'm
>> currently running into is that I need to move the
>> /var/lib/nfs/rpc_pipefs mountpoint outside of /var/lib/nfs.
>> The original mountpoint is handled by
>> /usr/lib/systemd/system/var-lib-nfs-rpc_pipefs.mount which comes as part
>> of the nfs-utils RPM.
>> So my initial naive idea was to create a drop-in in /etc/systemd/system
>> and override the "Where" option but that's when I learned that this
>> option cannot differ from the mount unit filename.
>>
>> This creates a dilemma for me since I shouldn't modify the original
>> mount unit both in principle and because it would mess up things
>> horribly when updating. Due to the limitations on the mount unit
>> filename I cannot create a drop-in directory either though so I'm not
>> sure what the appropriate way to handle this situation is.
>>
>> The only way I can think of is to disable/mask the original mount unit
>> and create a completely new one or is there another way to deal with
>> this?

One problem that complicates this is that various NFS services require
this mount unit which means a) masking that unit will break the startup
of these services and b) using an alternative unit file would result in
it no longer getting mounted automatically.

The alias thing is worth a try though so I need to experiment what
happens when I mask unit X and then create a new unit Y that has X as an
alias to see if the alias or the masking take precedence.

I really wish that one could specify an abstract unit name instead of
this specific naming requirement as that essentially leads to some
implicit dependencies not based on units but actual path names.

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


[systemd-devel] one shot service exit-code

2017-10-31 Thread Matt Zagrabelny
Greetings,

I have phone that I plug into my computer and have a udev rule to fire off
a systemd service. Things work well, but the journal indicates that the
command isn't terminating cleanly.

Here is the udev rules. Added for completeness:
% cat /etc/udev/rules.d/90-galaxy-note-3.rules
# Download photos from Galaxy Note 3
ACTION=="add" \
ENV{ID_MTP_DEVICE}=="1" \
ENV{ID_VENDOR_ID}=="04e8" \
ENV{ID_MODEL_ID}=="6860" \
ENV{ID_SERIAL_SHORT}=="17b765cc" \
TAG+="systemd" \
PROGRAM="/bin/systemd-escape --template=download-photos@.service
$env{ID_SERIAL}" \
ENV{SYSTEMD_USER_WANTS}+="%c"

Here is my unit file with a minimal ExecStart that exhibits the problem:

% cat ~/.config/systemd/user/download-photos@.service
[Service]
Type=oneshot
ExecStart=/usr/bin/mate-terminal --command '/bin/cat /dev/null'

Here is the same command executed from a (secondary) terminal:

/usr/bin/mate-terminal --command '/bin/cat /dev/null'
echo $?
0

However here is the journal when I plug in the phone:

Oct 31 10:53:54 eruke systemd[1274]: Starting
download-photos@SAMSUNG_SAMSUNG_Android_17b765cc.service...
Oct 31 10:53:55 eruke systemd[1274]:
download-photos@SAMSUNG_SAMSUNG_Android_17b765cc.service: Main process
exited, code=exited, status=255/n/a
Oct 31 10:53:55 eruke systemd[1274]:
download-photos@SAMSUNG_SAMSUNG_Android_17b765cc.service: Failed with
result 'exit-code'.
Oct 31 10:53:55 eruke systemd[1274]: Failed to start
download-photos@SAMSUNG_SAMSUNG_Android_17b765cc.service.

When I replace "/bin/cat /dev/null" with the actual script to download
photos from the phone I get the same error in the journal. The downloading
script does the job (I get the photos downloaded and the correct output is
in the mate-terminal that systemd spawned) so it is "succeeding", but I
keep getting "Failed" in the journal due to the 'exit-code'.

This issue seems related to the ExecStart having '/usr/bin/mate-terminal'.
If I instead use

ExecStart=/bin/cat /dev/null

in the unit, then I do not get the "Failed with result 'exit-code'" message
in the journal, so the evidence is pointing at the mate-terminal
interaction with systemd.

Does anyone have any ideas how systemd is interacting (killing?) with the
mate-terminal?

Thanks for any pointers!

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


Re: [systemd-devel] one shot service exit-code

2017-10-31 Thread Reindl Harald



Am 31.10.2017 um 17:06 schrieb Matt Zagrabelny:
I have phone that I plug into my computer and have a udev rule to fire 
off a systemd service. Things work well, but the journal indicates that 
the command isn't terminating cleanly.


However here is the journal when I plug in the phone:

Oct 31 10:53:54 eruke systemd[1274]: Starting 
download-photos@SAMSUNG_SAMSUNG_Android_17b765cc.service...
Oct 31 10:53:55 eruke systemd[1274]: 
download-photos@SAMSUNG_SAMSUNG_Android_17b765cc.service: Main process 
exited, code=exited, status=255/n/a


SuccessExitStatus=255
Does anyone have any ideas how systemd is interacting (killing?) with 
the mate-terminal?


just tell systemd 255 is a normal exit code, see above

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


Re: [systemd-devel] one shot service exit-code

2017-10-31 Thread Matt Zagrabelny
On Tue, Oct 31, 2017 at 11:29 AM, Reindl Harald 
wrote:

>
>
>> Any ideas why the terminal exit code is 0 from another terminal, but when
>> systemd spawns it, it is 255?
>>
>
> that's a question for gnome developers and i din't touch anything from
> them until i am forced so, they probalby don't gasp the 0 is the default
> return code on unix/linux


Hmmm... the return code is 0 when I start the mate-terminal from another
mate-terminal. ???

Oh, well.

Thanks for the help. It works like a charm:

Oct 31 11:32:22 eruke systemd[1274]: Starting
download-photos@SAMSUNG_SAMSUNG_Android_17b765cc.service...
Oct 31 11:32:25 eruke systemd[1274]: Started
download-photos@SAMSUNG_SAMSUNG_Android_17b765cc.service.

and the unit for posterity:

cat ~/.config/systemd/user/download-photos@.service
[Service]
Type=oneshot
ExecStart=/usr/bin/mate-terminal --maximize --command '/usr/bin/imagdo
--config-file %h/.imagdo/%I.yaml'
SuccessExitStatus=0 255

Cheers!

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


Re: [systemd-devel] one shot service exit-code

2017-10-31 Thread Matt Zagrabelny
On Tue, Oct 31, 2017 at 11:21 AM, Reindl Harald 
wrote:

>
>
> Am 31.10.2017 um 17:06 schrieb Matt Zagrabelny:
>
>> I have phone that I plug into my computer and have a udev rule to fire
>> off a systemd service. Things work well, but the journal indicates that the
>> command isn't terminating cleanly.
>>
>> However here is the journal when I plug in the phone:
>>
>> Oct 31 10:53:54 eruke systemd[1274]: Starting
>> download-photos@SAMSUNG_SAMSUNG_Android_17b765cc.service...
>> Oct 31 10:53:55 eruke systemd[1274]: 
>> download-photos@SAMSUNG_SAMSUNG_Android_17b765cc.service:
>> Main process exited, code=exited, status=255/n/a
>>
>
> SuccessExitStatus=255
>
>> Does anyone have any ideas how systemd is interacting (killing?) with the
>> mate-terminal?
>>
>
> just tell systemd 255 is a normal exit code, see above
>

Thanks Reindl!

Any ideas why the terminal exit code is 0 from another terminal, but when
systemd spawns it, it is 255?

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


Re: [systemd-devel] one shot service exit-code

2017-10-31 Thread Reindl Harald



Am 31.10.2017 um 17:26 schrieb Matt Zagrabelny:
On Tue, Oct 31, 2017 at 11:21 AM, Reindl Harald > wrote:




Am 31.10.2017 um 17:06 schrieb Matt Zagrabelny:

I have phone that I plug into my computer and have a udev rule
to fire off a systemd service. Things work well, but the journal
indicates that the command isn't terminating cleanly.

However here is the journal when I plug in the phone:

Oct 31 10:53:54 eruke systemd[1274]: Starting
download-photos@SAMSUNG_SAMSUNG_Android_17b765cc.service...
Oct 31 10:53:55 eruke systemd[1274]:
download-photos@SAMSUNG_SAMSUNG_Android_17b765cc.service: Main
process exited, code=exited, status=255/n/a


SuccessExitStatus=255

Does anyone have any ideas how systemd is interacting (killing?)
with the mate-terminal?


just tell systemd 255 is a normal exit code, see above


Thanks Reindl!

Any ideas why the terminal exit code is 0 from another terminal, but 
when systemd spawns it, it is 255?


that's a question for gnome developers and i din't touch anything from 
them until i am forced so, they probalby don't gasp the 0 is the default 
return code on unix/linux

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


Re: [systemd-devel] udev

2017-10-31 Thread David Henderson
Good afternoon all.  So is there another place I can get help for this problem?

Thanks,
Dave


On 10/30/17, David Henderson  wrote:
> Good morning all!  Just following up with this!
>
> Thanks,
> Dave
>
>
> On 10/26/17, David Henderson  wrote:
>> On 10/26/17, David Henderson  wrote:
>>> So I am using the compile flags as suggested, however, I have noticed
>>> two errors.  I tried passing '--enable-static' to 'configure' and end
>>> up with:
>>>
>>> checking if libtool supports shared libraries... yes
>>> checking whether to build shared libraries... yes
>>> checking whether to build static libraries... yes
>>> configure: error: --enable-static is not supported by systemd
>>>
>>> Without it, I get passed that error in favor of another one:
>>>
>>> checking if libtool supports shared libraries... yes
>>> checking whether to build shared libraries... yes
>>> checking whether to build static libraries... no
>>> checking for intltool-merge... yes
>>> checking whether NLS is requested... yes
>>> checking for intltool >= 0.40.0... 0.51.0 found
>>> checking for intltool-update... /usr/local/bin/intltool-update
>>> checking for intltool-merge... /usr/local/bin/intltool-merge
>>> checking for intltool-extract... /usr/local/bin/intltool-extract
>>> checking for xgettext... /usr/local/bin/xgettext
>>> checking for msgmerge... /usr/local/bin/msgmerge
>>> checking for msgfmt... /usr/local/bin/msgfmt
>>> checking for gmsgfmt... /usr/local/bin/msgfmt
>>> /usr/local/bin/xgettext: error while loading shared libraries:
>>> libgettextsrc-0.19.5.1.so: cannot open shared object file: No such
>>> file or directory
>>> /usr/local/bin/msgmerge: error while loading shared libraries:
>>> libgettextsrc-0.19.5.1.so: cannot open shared object file: No such
>>> file or directory
>>> /usr/local/bin/msgfmt: error while loading shared libraries:
>>> libgettextsrc-0.19.5.1.so: cannot open shared object file: No such
>>> file or directory
>>> configure: error: GNU gettext tools not found; required for intltool
>>>
>>> However, I have verified that the file does in fact exist and is
>>> located in /usr/local/lib.  I tried adding '-L/usr/local/lib' to the
>>> LDFLAGS variable, but no change.  Is it an issue with needing to be a
>>> newer version or something?
>>>
>>
>> So it appears that the binaries were looking for the lib in /lib,
>> although they were actually in /usr/local/lib.  A few symlinks
>> corrected that issue.  However, I have no run into another issue:
>>
>> checking for qemu-system-x86_64... no
>> checking for /usr/share/qemu/bios-ovmf.bin... no
>> checking for /usr/share/qemu-ovmf/bios.bin... no
>> checking that generated files are newer than configure... done
>> configure: creating ./config.status
>> config.status: creating Makefile
>> config.status: error: cannot find input file: `po/Makefile.in.in'
>>
>> Checking the config.log says:
>>
>> ## -- ##
>> ## Running config.status. ##
>> ## -- ##
>>
>> This file was extended by systemd config.status 234, which was
>> generated by GNU Autoconf 2.69.  Invocation command line was
>>
>>   CONFIG_FILES=
>>   CONFIG_HEADERS  =
>>   CONFIG_LINKS=
>>   CONFIG_COMMANDS =
>>   $ ./config.status
>>
>> on b46de142dd54
>>
>> config.status:1555: creating Makefile
>> config.status:1541: error: cannot find input file: `po/Makefile.in.in'
>>
>>
>> I have installed glib2-dev and gettext-dev and intltool which each has
>> a Makefile.in.in file:
>>
>> /usr/local/share/gettext/po/Makefile.in.in
>> /usr/local/share/glib-2.0/gettext/po/Makefile.in.in
>> /usr/local/share/intltool/Makefile.in.in
>>
>> It doesn't appear to be the last one since the file isn't located in
>> the 'po' directory.  Any thoughts?
>>
>> Thanks,
>> Dave
>>
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Is there a way to recover from a crashed systemd without rebooting?

2017-10-31 Thread Daniel Wang
I hit a bug in systemd-232 and it crashed. Anything I tried to do with
`systemctl`, including `systemctl daemon-reexec` seemed to rely on the
systemd dbus service, which all resulted in `Failed to activate service
'org.freedesktop.systemd1': timed out`.

systemd runs as PID 1. Is there any way to recover without a reboot?

-- 
Best,
Daniel


smime.p7s
Description: S/MIME Cryptographic Signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel