Re: [systemd-devel] systemctl isolate foo.service expands to foo.service.target

2014-11-28 Thread Chris Atkinson
How does this interact with snapshots? While I was looking at man
systemctl it seems that one uses isolate to restore to a previous
snapshot:

   Snapshot Commands
   snapshot [NAME]
   Create a snapshot. If a snapshot name is specified, the new
   snapshot will be named after it. If none is specified, an automatic
   snapshot name is generated. In either case, the snapshot name used
   is printed to standard output, unless --quiet is specified.

   A snapshot refers to a saved state of the systemd manager.
   It is implemented itself as a unit that is generated
   dynamically with this command and has dependencies on all
   units active at the time. At a later time, the user may
   return to this state by using the isolate command on the
   snapshot unit.

   Snapshots are only useful for saving and restoring which
   units are running or are stopped, they do not save/restore
   any other state. Snapshots are dynamic and lost on reboot.

I created a named snapshot:

$ sudo systemctl snapshot derpy
derpy.snapshot

I tried restoring the named snapshot, but the mandatory mangling
to .target got in the way:

$ sudo systemctl isolate derpy.snapshot
Failed to start derpy.snapshot.target: Operation refused, unit may not
be isolated.

Results were the same with an automatically named snapshot.

Did I misunderstand the man page and there's some other way to restore
a snapshot?

Thanks,
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemctl isolate foo.service expands to foo.service.target

2014-11-28 Thread Zbigniew Jędrzejewski-Szmek
On Fri, Nov 28, 2014 at 10:40:31AM -0500, Chris Atkinson wrote:
 I created a named snapshot:
 
 $ sudo systemctl snapshot derpy
 derpy.snapshot
 
 I tried restoring the named snapshot, but the mandatory mangling
 to .target got in the way:
 
 $ sudo systemctl isolate derpy.snapshot
 Failed to start derpy.snapshot.target: Operation refused, unit may not
 be isolated.

This was an unintended side effect. I will push a commit to only
append the suffix in there isn't one already. If I say 'systemctl
set-default goo.device' I want to get an error, not get promoted to
goo.device.service.

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


Re: [systemd-devel] systemctl isolate foo.service expands to foo.service.target

2014-11-28 Thread Chris Atkinson
The commit (5e03c6e3b517286bbd65b48d88f60e5b83721894) seems to be
having some side effects.

When I attempt to query status, stop or start a service I get
the following:

$ sudo systemctl stop transmission
Assertion 'suffix' failed at src/shared/unit-name.c:515, function
unit_name_mangle_with_suffix(). Aborting.

journalctl shows the following coredump:

Process 4687 (systemctl) of user 0 dumped core.

Stack trace of thread 4687:
#0  0x7fb3bf640a97  raise (libc.so.6)
#1  0x7fb3bf641e6a  abort (libc.so.6)
#2  0x7fb3c051b462  log_assert_failed (systemctl)
#3  0x7fb3c052e4ef  unit_name_mangle_with_suffix (systemctl)
#4  0x7fb3c050d12d  expand_names.lto_priv.398 (systemctl)
#5  0x7fb3c05185cc  check_unit_generic (systemctl)
#6  0x7fb3c050abe6  main (systemctl)
#7  0x7fb3bf62d040  __libc_start_main (libc.so.6)
#8  0x7fb3c050b64c  _start (systemctl)

Attempts to isolate a snapshot fail silently with the same coredump.

Attempts to isolate to default.target worked but attempts to isolate
back to a user-defined .target failed.

systemd was compiled with glibc 2.20 and the following flags:

--libexecdir=/usr/lib \
--localstatedir=/var \
--sysconfdir=/etc \
--enable-introspection \
--enable-gtk-doc \
--enable-compat-libs \
--disable-audit \
--disable-ima \
--disable-multi-seat-x \
--disable-smack \
--with-sysvinit-path= \
--with-sysvrcnd-path= \
--with-firmware-path=/usr/lib/firmware/updates:/usr/lib/firmware\
--with-ntp-servers=${timeservers[*]}

Please let me know if there are any items you'd like me to test or
additional information you would find useful.

Regards,







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


Re: [systemd-devel] systemctl isolate foo.service expands to foo.service.target

2014-11-28 Thread Zbigniew Jędrzejewski-Szmek
On Fri, Nov 28, 2014 at 01:09:18PM -0500, Chris Atkinson wrote:
 The commit (5e03c6e3b517286bbd65b48d88f60e5b83721894) seems to be
 having some side effects.
 
 When I attempt to query status, stop or start a service I get
 the following:
 
 $ sudo systemctl stop transmission
 Assertion 'suffix' failed at src/shared/unit-name.c:515, function
 unit_name_mangle_with_suffix(). Aborting.
Yeah, I noticed that too :) It was a last minute cleanup I added
to the patch, it's now reverted.

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


Re: [systemd-devel] systemctl isolate foo.service expands to foo.service.target

2014-11-28 Thread Chris Atkinson
Commit e80733be33e52d8ab2f1ae845326d39c600f5612 seems to have done the
trick.

I'm able to start, stop and status services, isolate .target
and .snapshot files and a filename with no extension following
isolate is treated as a .target, all of which seems right.

The systemctl man page will still need tweaking; I will do so unless you
object.

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


Re: [systemd-devel] systemctl isolate foo.service expands to foo.service.target

2014-11-28 Thread Zbigniew Jędrzejewski-Szmek
On Fri, Nov 28, 2014 at 02:02:24PM -0500, Chris Atkinson wrote:
 Commit e80733be33e52d8ab2f1ae845326d39c600f5612 seems to have done the
 trick.
 
 I'm able to start, stop and status services, isolate .target
 and .snapshot files and a filename with no extension following
 isolate is treated as a .target, all of which seems right.
 
 The systemctl man page will still need tweaking; I will do so unless you
 object.
No, of course not, please go ahead.

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


[systemd-devel] systemctl isolate foo.service expands to foo.service.target

2014-11-27 Thread WANG Chao
Hi, All

I happen to notice systemctl isolate will expands foo.service to
foo.service.target, which unfortunately breaks my boot in some way.

I find the following commit:

commit 0807312
Author: Lennart Poettering lenn...@poettering.net
Date:   Mon Oct 13 15:43:09 2014 +0200

systemctl: when mangle unit names for the isolate, suffix with .target 
rather than .service by default

After all, we set AllowIsolate exclusively for target units so far, and
this is more or less the only thing tht makes sense, hence also use
.target as completion suffix by default.


Does it mean we can only isolate to a target unit from now on?

Thanks
WANG Chao
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemctl isolate foo.service expands to foo.service.target

2014-11-27 Thread Andrei Borzenkov
В Fri, 28 Nov 2014 15:11:29 +0800
WANG Chao chaow...@redhat.com пишет:

 Hi, All
 
 I happen to notice systemctl isolate will expands foo.service to
 foo.service.target, which unfortunately breaks my boot in some way.
 
 I find the following commit:
 
 commit 0807312
 Author: Lennart Poettering lenn...@poettering.net
 Date:   Mon Oct 13 15:43:09 2014 +0200
 
 systemctl: when mangle unit names for the isolate, suffix with 
 .target rather than .service by default
 
 After all, we set AllowIsolate exclusively for target units so far, and
 this is more or less the only thing tht makes sense, hence also use
 .target as completion suffix by default.
 
 
 Does it mean we can only isolate to a target unit from now on?
 

I believe, it was always intended to be used with targets only.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemctl isolate foo.service expands to foo.service.target

2014-11-27 Thread WANG Chao
On 11/28/14 at 10:13am, Andrei Borzenkov wrote:
 В Fri, 28 Nov 2014 15:11:29 +0800
 WANG Chao chaow...@redhat.com пишет:
 
  Hi, All
  
  I happen to notice systemctl isolate will expands foo.service to
  foo.service.target, which unfortunately breaks my boot in some way.
  
  I find the following commit:
  
  commit 0807312
  Author: Lennart Poettering lenn...@poettering.net
  Date:   Mon Oct 13 15:43:09 2014 +0200
  
  systemctl: when mangle unit names for the isolate, suffix with 
  .target rather than .service by default
  
  After all, we set AllowIsolate exclusively for target units so far, and
  this is more or less the only thing tht makes sense, hence also use
  .target as completion suffix by default.
  
  
  Does it mean we can only isolate to a target unit from now on?
  
 
 I believe, it was always intended to be used with targets only.

Thanks. And I believe it's time to update the man page, or I wouldn't
have asked the question.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel