I would also like to note that when I run the script I created through the bash interpreter from tty it works just fine. Exactly as intended. I can then switch back to my user and move the tty to my new cgroup.
The only time it doesn't work is when I attempt to call it from the systemd unit. It says i own the cgroup, but it is almost like I do not. Very weird. I can use sudo, but it isn't my preferred method. Also it has the same issue if I try to run it via the systemd unit. On Fri, Oct 9, 2015 at 2:18 AM, Fajar A. Nugraha <l...@fajar.net> wrote: > On Fri, Oct 9, 2015 at 7:19 AM, Paul Jones <spacefrea...@gmail.com> wrote: > > I have tried this but for some reason I am having trouble. > > > > I have pastebins for my systemd unit file and the bash script it calls. > > http://pastebin.com/FLtLWaih > > http://pastebin.com/b9qM2a9J > > > > It appears as though it succesfully creates the cgroup "me", i see it, > and i > > own it and have seemingly correct permission to it. But as my normal > user I > > cannot move the current tty to that cgroup. I cannot even do it as root! > > > Try this: > > (1) on top of /etc/sudoers: > Defaults use_pty > > Short version: with this, sudo will create new pty owned by the user. > Needed if you intend to run "screen" (or other stuff which needs > user-owned tty). Not needed if you only need to run "lxc-attach" or > "lxc-console". > > (2) at the bottom of /etc/pam.d/sudo > session optional pam_loginuid.so > session optional pam_systemd.so > > Short version: make pam_systemd create and use new cgroup owned by the > user when you run "sudo". With this, you can use "sudo" for > "lxc-autostart". > > (3) on your script ("paul" is your username, right?) > /usr/bin/sudo -u paul -i -- /usr/bin/lxc-autostart > > -- > Fajar > _______________________________________________ > lxc-users mailing list > lxc-users@lists.linuxcontainers.org > http://lists.linuxcontainers.org/listinfo/lxc-users > -- Time To Get an EKG, G!
_______________________________________________ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users