[Bug 1518440] [NEW] tgt fails to install in LXD

2015-11-20 Thread Lee Trager
Public bug reported:

When trying to install tgt in an LXD container the post install script
fails. I've tried setting the container profile as uncontained as per
https://help.ubuntu.com/lts/serverguide/lxc.html#lxc-apparmor to no
avail. This is preventing MAAS from being able to be run in an LXD
container.


# apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up tgt (1:1.0.57-1ubuntu2) ...
Job for tgt.service failed because the control process exited with error code. 
See "systemctl status tgt.service" and "journalctl -xe" for details.
invoke-rc.d: initscript tgt, action "start" failed.
dpkg: error processing package tgt (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 tgt
E: Sub-process /usr/bin/dpkg returned an error code (1)


# systemctl status tgt.service
● tgt.service - (i)SCSI target daemon
   Loaded: loaded (/lib/systemd/system/tgt.service; enabled; vendor preset: 
enabled)
   Active: failed (Result: start-limit) since Fri 2015-11-20 19:29:28 UTC; 14s 
ago
 Docs: man:tgtd(8)
  Process: 24536 ExecStop=/usr/sbin/tgtadm --op update --mode sys --name State 
-v offline (code=exited, status=107)
  Process: 24521 ExecStart=/usr/sbin/tgtd -f (code=exited, status=1/FAILURE)
 Main PID: 24521 (code=exited, status=1/FAILURE)

Nov 20 19:29:28 maas-dev systemd[1]: Failed to start (i)SCSI target daemon.
Nov 20 19:29:28 maas-dev systemd[1]: tgt.service: Unit entered failed state.
Nov 20 19:29:28 maas-dev systemd[1]: tgt.service: Failed with result 
'exit-code'.
Nov 20 19:29:28 maas-dev systemd[1]: tgt.service: Service hold-off time over, 
scheduling restart.
Nov 20 19:29:28 maas-dev systemd[1]: Stopped (i)SCSI target daemon.
Nov 20 19:29:28 maas-dev systemd[1]: tgt.service: Start request repeated too 
quickly.
Nov 20 19:29:28 maas-dev systemd[1]: Failed to start (i)SCSI target daemon.
Nov 20 19:29:28 maas-dev systemd[1]: tgt.service: Unit entered failed state.
Nov 20 19:29:28 maas-dev systemd[1]: tgt.service: Failed with result 
'start-limit'.


# journalctl -f # while running apt-get install tgt
Nov 20 19:39:29 maas-dev polkitd(authority=local)[1828]: Registered 
Authentication Agent for unix-process:24816:14005113 (system bus name :1.78 
[/usr/bin/pkttyagent --notify-fd 4 --fallback], object path 
/org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
Nov 20 19:39:29 maas-dev systemd[1]: Reloading.
Nov 20 19:39:29 maas-dev polkitd(authority=local)[1828]: Unregistered 
Authentication Agent for unix-process:24816:14005113 (system bus name :1.78, 
object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale 
en_US.UTF-8) (disconnected from bus)
Nov 20 19:39:29 maas-dev polkitd(authority=local)[1828]: Registered 
Authentication Agent for unix-process:24894:14005139 (system bus name :1.79 
[/usr/bin/pkttyagent --notify-fd 4 --fallback], object path 
/org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
Nov 20 19:39:29 maas-dev systemd[1]: Reloading.
Nov 20 19:39:30 maas-dev polkitd(authority=local)[1828]: Unregistered 
Authentication Agent for unix-process:24894:14005139 (system bus name :1.79, 
object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale 
en_US.UTF-8) (disconnected from bus)
Nov 20 19:39:30 maas-dev polkitd(authority=local)[1828]: Registered 
Authentication Agent for unix-process:24957:14005162 (system bus name :1.80 
[/usr/bin/pkttyagent --notify-fd 4 --fallback], object path 
/org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
Nov 20 19:39:30 maas-dev systemd[1]: Starting (i)SCSI target daemon...
Nov 20 19:39:30 maas-dev tgtd[24974]: tgtd: iser_ib_init(3436) Failed to 
initialize RDMA; load kernel modules?
Nov 20 19:39:30 maas-dev tgtd[24974]: can't adjust oom-killer's pardon 
/proc/self/oom_score_adj, Permission denied
Nov 20 19:39:33 maas-dev systemd[1]: dev-.lxd\x2dmounts.mount: Failed to create 
cgroup /lxc/maas-dev-11/system.slice/dev-.lxd\x2dmounts.mount: No such file or 
directory
Nov 20 19:39:33 maas-dev systemd[1]: Failed to realize cgroups for queued unit 
dev-.lxd\x2dmounts.mount, ignoring: No such file or directory
Nov 20 19:39:34 maas-dev systemd[1]: proc-sysrq\x2dtrigger.mount: Failed to 
create cgroup /lxc/maas-dev-11/system.slice/proc-sysrq\x2dtrigger.mount: No 
such file or directory
Nov 20 19:39:34 maas-dev systemd[1]: Failed to realize cgroups for queued unit 
proc-sysrq\x2dtrigger.mount, ignoring: No such file or directory
Nov 20 19:39:35 maas-dev systemd[1]: tgt.service: Main process exited, 
code=exited, status=1/FAILURE
Nov 20 19:39:35 maas-dev systemd[1]: dev-.lxd\x2dmounts.mount: Failed to create 
cgroup /lxc/maas-dev-11/system.slice/dev-.lxd\x2dmounts.mount: No such file or 
directory
Nov 20 19:39:35 

[Bug 1518440] Re: tgt fails to install in LXD

2015-11-20 Thread Lee Trager
** Description changed:

- When trying to install tgt in an LXD container the post install script
- fails. I've tried setting the container profile as uncontained as per
- https://help.ubuntu.com/lts/serverguide/lxc.html#lxc-apparmor to no
- avail. This is preventing MAAS from being able to be run in an LXD
- container.
+ When trying to install tgt in an LXD container the post install script fails. 
I've tried setting the container profile as uncontained as per 
https://help.ubuntu.com/lts/serverguide/lxc.html#lxc-apparmor to no avail. This 
is preventing MAAS from being able to be run in an LXD container.
+ /system.slice/tgt.service)
  
  
- # apt-get install -f
+ root@maas-dev:~# apt-get install -f
  Reading package lists... Done
- Building dependency tree
+ Building dependency tree   
  Reading state information... Done
  0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  1 not fully installed or removed.
  After this operation, 0 B of additional disk space will be used.
  Setting up tgt (1:1.0.57-1ubuntu2) ...
  Job for tgt.service failed because the control process exited with error 
code. See "systemctl status tgt.service" and "journalctl -xe" for details.
  invoke-rc.d: initscript tgt, action "start" failed.
  dpkg: error processing package tgt (--configure):
-  subprocess installed post-installation script returned error exit status 1
- Errors were encountered while processing:
-  tgt
+  subprocess installed post-installation script returned error exit status 1
  E: Sub-process /usr/bin/dpkg returned an error code (1)
  
  
  # systemctl status tgt.service
  ● tgt.service - (i)SCSI target daemon
-    Loaded: loaded (/lib/systemd/system/tgt.service; enabled; vendor preset: 
enabled)
-    Active: failed (Result: start-limit) since Fri 2015-11-20 19:29:28 UTC; 
14s ago
-  Docs: man:tgtd(8)
-   Process: 24536 ExecStop=/usr/sbin/tgtadm --op update --mode sys --name 
State -v offline (code=exited, status=107)
-   Process: 24521 ExecStart=/usr/sbin/tgtd -f (code=exited, status=1/FAILURE)
-  Main PID: 24521 (code=exited, status=1/FAILURE)
+Loaded: loaded (/lib/systemd/system/tgt.service; enabled; vendor preset: 
enabled)
+Active: failed (Result: start-limit) since Fri 2015-11-20 19:51:45 UTC; 
2min 25s ago
+  Docs: man:tgtd(8)
+   Process: 31872 ExecStop=/usr/sbin/tgtadm --op update --mode sys --name 
State -v offline (code=exited, status=107)
+   Process: 31857 ExecStart=/usr/sbin/tgtd -f (code=exited, status=1/FAILURE)
+  Main PID: 31857 (code=exited, status=1/FAILURE)
  
- Nov 20 19:29:28 maas-dev systemd[1]: Failed to start (i)SCSI target daemon.
- Nov 20 19:29:28 maas-dev systemd[1]: tgt.service: Unit entered failed state.
- Nov 20 19:29:28 maas-dev systemd[1]: tgt.service: Failed with result 
'exit-code'.
- Nov 20 19:29:28 maas-dev systemd[1]: tgt.service: Service hold-off time over, 
scheduling restart.
- Nov 20 19:29:28 maas-dev systemd[1]: Stopped (i)SCSI target daemon.
- Nov 20 19:29:28 maas-dev systemd[1]: tgt.service: Start request repeated too 
quickly.
- Nov 20 19:29:28 maas-dev systemd[1]: Failed to start (i)SCSI target daemon.
- Nov 20 19:29:28 maas-dev systemd[1]: tgt.service: Unit entered failed state.
- Nov 20 19:29:28 maas-dev systemd[1]: tgt.service: Failed with result 
'start-limit'.
+ Nov 20 19:51:45 maas-dev systemd[1]: Failed to start (i)SCSI target daemon.
+ Nov 20 19:51:45 maas-dev systemd[1]: tgt.service: Unit entered failed state.
+ Nov 20 19:51:45 maas-dev systemd[1]: tgt.service: Failed with result 
'exit-code'.
+ Nov 20 19:51:45 maas-dev systemd[1]: tgt.service: Service hold-off time over, 
scheduling restart.
+ Nov 20 19:51:45 maas-dev systemd[1]: Stopped (i)SCSI target daemon.
+ Nov 20 19:51:45 maas-dev systemd[1]: tgt.service: Start request repeated too 
quickly.
+ Nov 20 19:51:45 maas-dev systemd[1]: Failed to start (i)SCSI target daemon.
+ Nov 20 19:51:45 maas-dev systemd[1]: tgt.service: Unit entered failed state.
+ Nov 20 19:51:45 maas-dev systemd[1]: tgt.service: Failed with result 
'start-limit'.
  
  
- # journalctl -f # while running apt-get install tgt
- Nov 20 19:39:29 maas-dev polkitd(authority=local)[1828]: Registered 
Authentication Agent for unix-process:24816:14005113 (system bus name :1.78 
[/usr/bin/pkttyagent --notify-fd 4 --fallback], object path 
/org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
- Nov 20 19:39:29 maas-dev systemd[1]: Reloading.
- Nov 20 19:39:29 maas-dev polkitd(authority=local)[1828]: Unregistered 
Authentication Agent for unix-process:24816:14005113 (system bus name :1.78, 
object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale 
en_US.UTF-8) (disconnected from bus)
- Nov 20 19:39:29 maas-dev polkitd(authority=local)[1828]: Registered 
Authentication Agent for unix-process:24894:14005139 (system bus name :1.79 
[/usr/bin/pkttyagent --notify-fd 4 --fallback], object path 
/org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
- Nov 20 19:39:29 maas-dev