Re: [systemd-devel] Machinectl shell/login do not attach to console

2015-10-17 Thread Lennart Poettering
On Fri, 16.10.15 14:01, Chris Bell (cwb...@narmos.org) wrote:

> On 2015-10-16 13:55, Chris Bell wrote:
> >On 2015-10-14 15:58, Lennart Poettering wrote:
> >>On Mon, 05.10.15 12:30, Chris Bell (cwb...@narmos.org) wrote:
> >>
> >>>Hi all,
> >>>
> >>>I have an Arch machine with systemd 226, running an Arch container,
> >>>also
> >>>with systemd 226. For whatever reason in 225, `machinectl login`
> >>>stopped
> >>>working correctly, and in 226 `machinectl login` does not work
> >>>properly. It
> >>>attaches to the machine, but does not seem to redirect stdin and
> >>>stdout to
> >>>the machine. When I attempt to use login, the login prompt is never
> >>>printed
> >>>to the command line:
> >>
> >>There were some races when machinectl was too fast and the systemd
> >>inside the container too slow. This should be fixed in systemd git,
> >>specifically commit 40e1f4ea7458a0a80eaf1ef356e52bfe0835412e and
> >>related.
> >
> >I've recompiled from git, and the problem has, indeed, been solved! Thank
> >you!
> 
> Sorry, I was wrong. I was running 'machinectl shell' without a machine name,
> and it spawned a shell for my host machine. Guest machine still cannot be
> accessed with 'shell' or 'login' and stdin/out are still redirected to the
> journal.
> 
> I compiled commit 7a1e5abbc6e741e5b6995288c607522faa69c8b4 (Master) from the
> github repo.

You have to upgrade systemd, machined and nspawn in the container as
well as on the host, and ensure you reexec all three of these
components. Otherwise the fix has no effect.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Machinectl shell/login do not attach to console

2015-10-17 Thread arnaud gaboury
Honestly, I don't think your issue has to do with the container systemd version.

On my host, archlinux:  systemd 227-1
On my container, Fedora 22:  sysetemd 219

-
# machinectl login poppy
[sudo] password for gabx:
Connected to machine poppy. Press ^] three times within 1s to exit session.

Fedora release 22 (Twenty Two)
Kernel 4.2.2-1-hortensia on an x86_64 (pts/0)

poppy login:


It is working fine.

On Sat, Oct 17, 2015 at 11:09 AM, Lennart Poettering
 wrote:
> On Fri, 16.10.15 14:01, Chris Bell (cwb...@narmos.org) wrote:
>
>> On 2015-10-16 13:55, Chris Bell wrote:
>> >On 2015-10-14 15:58, Lennart Poettering wrote:
>> >>On Mon, 05.10.15 12:30, Chris Bell (cwb...@narmos.org) wrote:
>> >>
>> >>>Hi all,
>> >>>
>> >>>I have an Arch machine with systemd 226, running an Arch container,
>> >>>also
>> >>>with systemd 226. For whatever reason in 225, `machinectl login`
>> >>>stopped
>> >>>working correctly, and in 226 `machinectl login` does not work
>> >>>properly. It
>> >>>attaches to the machine, but does not seem to redirect stdin and
>> >>>stdout to
>> >>>the machine. When I attempt to use login, the login prompt is never
>> >>>printed
>> >>>to the command line:
>> >>
>> >>There were some races when machinectl was too fast and the systemd
>> >>inside the container too slow. This should be fixed in systemd git,
>> >>specifically commit 40e1f4ea7458a0a80eaf1ef356e52bfe0835412e and
>> >>related.
>> >
>> >I've recompiled from git, and the problem has, indeed, been solved! Thank
>> >you!
>>
>> Sorry, I was wrong. I was running 'machinectl shell' without a machine name,
>> and it spawned a shell for my host machine. Guest machine still cannot be
>> accessed with 'shell' or 'login' and stdin/out are still redirected to the
>> journal.
>>
>> I compiled commit 7a1e5abbc6e741e5b6995288c607522faa69c8b4 (Master) from the
>> github repo.
>
> You have to upgrade systemd, machined and nspawn in the container as
> well as on the host, and ensure you reexec all three of these
> components. Otherwise the fix has no effect.
>
> Lennart
>
> --
> Lennart Poettering, Red Hat
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel



-- 

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


Re: [systemd-devel] Machinectl shell/login do not attach to console

2015-10-16 Thread Chris Bell

On 2015-10-16 13:55, Chris Bell wrote:

On 2015-10-14 15:58, Lennart Poettering wrote:

On Mon, 05.10.15 12:30, Chris Bell (cwb...@narmos.org) wrote:


Hi all,

I have an Arch machine with systemd 226, running an Arch container, 
also
with systemd 226. For whatever reason in 225, `machinectl login` 
stopped
working correctly, and in 226 `machinectl login` does not work 
properly. It
attaches to the machine, but does not seem to redirect stdin and 
stdout to
the machine. When I attempt to use login, the login prompt is never 
printed

to the command line:


There were some races when machinectl was too fast and the systemd
inside the container too slow. This should be fixed in systemd git,
specifically commit 40e1f4ea7458a0a80eaf1ef356e52bfe0835412e and 
related.


I've recompiled from git, and the problem has, indeed, been solved! 
Thank you!


Sorry, I was wrong. I was running 'machinectl shell' without a machine 
name, and it spawned a shell for my host machine. Guest machine still 
cannot be accessed with 'shell' or 'login' and stdin/out are still 
redirected to the journal.


I compiled commit 7a1e5abbc6e741e5b6995288c607522faa69c8b4 (Master) from 
the github repo.

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


Re: [systemd-devel] Machinectl shell/login do not attach to console

2015-10-16 Thread Chris Bell

On 2015-10-14 15:58, Lennart Poettering wrote:

On Mon, 05.10.15 12:30, Chris Bell (cwb...@narmos.org) wrote:


Hi all,

I have an Arch machine with systemd 226, running an Arch container, 
also
with systemd 226. For whatever reason in 225, `machinectl login` 
stopped
working correctly, and in 226 `machinectl login` does not work 
properly. It
attaches to the machine, but does not seem to redirect stdin and 
stdout to
the machine. When I attempt to use login, the login prompt is never 
printed

to the command line:


There were some races when machinectl was too fast and the systemd
inside the container too slow. This should be fixed in systemd git,
specifically commit 40e1f4ea7458a0a80eaf1ef356e52bfe0835412e and 
related.


I've recompiled from git, and the problem has, indeed, been solved! 
Thank you!


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


Re: [systemd-devel] Machinectl shell/login do not attach to console

2015-10-14 Thread Lennart Poettering
On Mon, 05.10.15 12:30, Chris Bell (cwb...@narmos.org) wrote:

> Hi all,
> 
> I have an Arch machine with systemd 226, running an Arch container, also
> with systemd 226. For whatever reason in 225, `machinectl login` stopped
> working correctly, and in 226 `machinectl login` does not work properly. It
> attaches to the machine, but does not seem to redirect stdin and stdout to
> the machine. When I attempt to use login, the login prompt is never printed
> to the command line:

There were some races when machinectl was too fast and the systemd
inside the container too slow. This should be fixed in systemd git,
specifically commit 40e1f4ea7458a0a80eaf1ef356e52bfe0835412e and related.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Machinectl shell/login do not attach to console

2015-10-14 Thread Chris Bell

On 2015-10-12 12:35, arnaud gaboury wrote:

On Mon, Oct 5, 2015 at 2:30 PM, Chris Bell  wrote:

Hi all,

I have an Arch machine with systemd 226,

which arch version exactly? I had the same issue with 226. It is gone
with 226-3.
setup: Arch host running Fedora container.


226-3 on host and guest. 227 is in testing, maybe that will fix it? I 
don't have any other ideas at this point.

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


Re: [systemd-devel] Machinectl shell/login do not attach to console

2015-10-12 Thread arnaud gaboury
On Mon, Oct 5, 2015 at 2:30 PM, Chris Bell  wrote:
> Hi all,
>
> I have an Arch machine with systemd 226,
which arch version exactly? I had the same issue with 226. It is gone
with 226-3.
setup: Arch host running Fedora container.

running an Arch container, also
> with systemd 226. For whatever reason in 225, `machinectl login` stopped
> working correctly, and in 226 `machinectl login` does not work properly. It
> attaches to the machine, but does not seem to redirect stdin and stdout to
> the machine. When I attempt to use login, the login prompt is never printed
> to the command line:
>
> # machinectl login gitlab
> Connected to machine gitlab. Press ^] three times within 1s to exit session.
> <>^]^]
> Connection to machine gitlab terminated.
>
> And nothing of note is printed in the journal (relevant date is Oct 5,
> machine was last started on Sep 28):
>
> # systemctl status systemd-nspawn@gitlab.service
> ● systemd-nspawn@gitlab.service - Container gitlab
>Loaded: loaded (/usr/lib/systemd/system/systemd-nspawn@.service; enabled;
> vendor preset: disabled)
>   Drop-In: /etc/systemd/system/systemd-nspawn@gitlab.service.d
>└─override.conf
>Active: active (running) since Mon 2015-09-28 08:11:33 EDT; 1 weeks 0
> days ago
>  Docs: man:systemd-nspawn(1)
>  Main PID: 18746 (systemd-nspawn)
>Status: "Container running."
>Memory: 1010.7M
>   CPU: 37min 13.126s
>CGroup: /machine.slice/systemd-nspawn@gitlab.service
>├─18746 /usr/bin/systemd-nspawn --quiet --keep-unit --boot
> --link-journal=try-guest --network-bridge=br0 --machine=gitlab
>├─init.scope
>│ └─18753 /usr/lib/systemd/systemd
>└─system.slice
>  ├─gitlab-sidekiq.service
>  │ ├─18886 sh -c sidekiq -q post_receive -q mailer -q
> system_hook -q project_web_hook -q gitlab_shell -q common -q default -q
> archive_repo -e production -L /var/log/gitlab/sidekiq.log >>
> /var/log/gitlab/sidekiq.log 2>&1
>  │ └─18904 sidekiq 3.3.0 gitlab [0 of 25 busy]
>  ├─dbus.service
>  │ └─18789 /usr/bin/dbus-daemon --system --address=systemd:
> --nofork --nopidfile --systemd-activation
>  ├─redis.service
>  │ └─18797 /usr/bin/redis-server 127.0.0.1:6379
>  ├─postfix.service
>  │ ├─18881 /usr/lib/postfix/bin/master -w
>  │ ├─18883 qmgr -l -t unix -u
>  │ └─25044 pickup -l -t unix -u
>  ├─systemd-journald.service
>  │ └─18772 /usr/lib/systemd/systemd-journald
>  ├─gitlab-unicorn.service
>  │ ├─18887 unicorn_rails master -c
> /usr/share/webapps/gitlab/config/unicorn.rb -E production
>  │ ├─25086 unicorn_rails worker[1] -c
> /usr/share/webapps/gitlab/config/unicorn.rb -E production
>  │ ├─25184 unicorn_rails worker[2] -c
> /usr/share/webapps/gitlab/config/unicorn.rb -E production
>  │ └─25355 unicorn_rails worker[0] -c
> /usr/share/webapps/gitlab/config/unicorn.rb -E production
>  ├─systemd-logind.service
>  │ └─18788 /usr/lib/systemd/systemd-logind
>  ├─postgresql.service
>  │ ├─18815 /usr/bin/postgres -D /var/lib/postgres/data
>  │ ├─18854 postgres: checkpointer process
>  │ ├─18855 postgres: writer process
>  │ ├─18856 postgres: wal writer process
>  │ ├─18857 postgres: autovacuum launcher process
>  │ ├─18858 postgres: stats collector process
>  │ ├─18945 postgres: gitlab_db gitlabhq_production [local] idle
>  │ ├─21179 postgres: gitlab_db gitlabhq_production [local] idle
>  │ ├─25090 postgres: gitlab_db gitlabhq_production [local] idle
>  │ ├─25366 postgres: gitlab_db gitlabhq_production [local] idle
>  │ └─25382 postgres: gitlab_db gitlabhq_production [local] idle
>  └─console-getty.service
>└─19441 /sbin/agetty --noclear --keep-baud console 115200
> 38400 9600 vt220
>
> Sep 28 08:11:35 zombie.narmos.org systemd-nspawn[18746]: zombie login: [  OK
> ] Started PostgreSQL database server.
> Sep 28 08:11:35 zombie.narmos.org systemd-nspawn[18746]: [  OK  ] Started
> GitLab Sidekiq Worker.
> Sep 28 08:11:35 zombie.narmos.org systemd-nspawn[18746]: [  OK  ] Started
> GitLab Unicorn Server.
> Sep 28 08:11:35 zombie.narmos.org systemd-nspawn[18746]: [  OK  ] Reached
> target Multi-User System.
> Sep 28 08:11:36 zombie.narmos.org systemd-nspawn[18746]: Arch Linux
> 4.1.6-1-ARCH (console)
> Sep 28 08:12:38 zombie.narmos.org systemd-nspawn[18746]: gitlab login:
> Sep 28 08:12:38 zombie.narmos.org systemd-nspawn[18746]: Arch Linux
> 4.1.6-1-ARCH (console)
> Sep 28 08:12:38 zombie.narmos.org systemd-nspawn[18746]: gitlab login: The
> Zombie, brought to you by Arch Linux 4.1.6-1-ARCH (pts/0)
> Sep 28 08:12:55 zombie.narmos.org systemd-nspawn[18746]: zombie login:
> Sep 28 

Re: [systemd-devel] Machinectl shell/login do not attach to console

2015-10-12 Thread Chris Bell

On 2015-10-05 12:30, Chris Bell wrote:

I have an Arch machine with systemd 226, running an Arch container,
also with systemd 226. For whatever reason in 225, `machinectl login`
stopped working correctly, and in 226 `machinectl login` does not work
properly. It attaches to the machine, but does not seem to redirect
stdin and stdout to the machine. When I attempt to use login, the
login prompt is never printed to the command line:


So I've done some more testing, and have not been able to come up with 
any solution. I have also simplified the scenario for the error:


First, I start the machine from a shell using:

# systemd-nspawn --boot --network-bridge=br0 --machine=gitlab

It boots and drops me to a login prompt:

Spawning container gitlab on /var/lib/machines/gitlab.
Press ^] three times within 1s to kill container.
systemd 226 running in system mode. (+PAM -AUDIT -SELINUX -IMA -APPARMOR 
+SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 
+SECCOMP +BLKID -ELFUTILS +KMOD +IDN)

Detected virtualization systemd-nspawn.
Detected architecture x86-64.

Welcome to Arch Linux!

[  OK  ] Reached target Multi-User System.

Arch Linux 4.1.6-1-ARCH (console)

gitlab login:

Where I can log in as root and use the machine as normal. If I attempt 
to spawn a `machinectl shell` from a second bash shell, it simply gives 
me the 'press ^] thre times...to exit' message. The login prompt is then 
printed on the original bash shell - the one where systemd-nspawn is 
running. All stdin and stdout is redirected from the shell that started 
'systemd-nspawn' - the shell where I ran 'machinectl shell' doesn't 
respond to anything but the kill command.


I could really use some help here!

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