DevelopersPL / otshosting-provisioning

Ansible playbook to provision OTS Hosting on Ubuntu 20.04
https://github.com/DevelopersPL/otshosting-provisioning/wiki
MIT License
33 stars 29 forks source link

systemd issues 16.04 #8

Closed jameswinegar closed 7 years ago

jameswinegar commented 8 years ago

Fresh ISO image of 16.04

running the following from user

sudo apt-get update
sudo apt-get install -y -q python-paramiko python-yaml python-jinja2 python-simplejson git-core ansible aptitude
sudo ansible-pull -i localhost, -U https://github.com/DevelopersPL/otshosting-provisioning.git -d /srv/otshosting-provisioning

Wait for configuration

su - otsmanager
systemctl --user status

Failed to get D-Bus connection: No such file or directory

I don't have much experience with systemd so can't do much troubleshooting.

DSpeichert commented 8 years ago

That is weird. You could try rebooting first. Then, make sure that regular (non-user) systemctl status works (as root). Finally, you can try running machinectl --uid=otsmanager shell as root instead of su.

jameswinegar commented 8 years ago

Just for reference, I am running inside a virtual machine, not that it should matter, testing what you suggested.

jameswinegar commented 8 years ago

Still experiencing issues; really just don't know why systemctl isn't picking up the otsmanager user.

Reboot prior to below:

standard:

james@james-Virtual-Machine:~$ su - otsmanager
Password: 
===================   MySQL   ===================
    phpMyAdmin: http://10.1.10.81:3380
    Username: otsmanager
    Password: *
    You can execute mysql commands without password.
    Total size and location of MySQL backups: 40K   /var/lib/automysqlbackup/
    Put your website files in /home/otsmanager/www/public_html

===================   TFS commands   ===================
 If you run TFS with the following commands, it will auto restart.
  Enable auto-start on boot:  enable tfs
 Disable auto-start on boot:  disable tfs
                  Start TFS:  start tfs
                   Stop TFS:  stop tfs
                Restart TFS:  restart tfs
        Check status of TFS:  status tfs
          Show full TFS log:  log tfs (q to exit)
         Follow TFS console:  follow tfs (CTRL+C to stop)

===================  Useful commands   ===================
Update TFS to latest master:  updatetfs
      Show service due date:  duedate
             Show server IP:  serverip
               Share a file:  transfer path/to/file

Failed to connect to bus: No such file or directory

systemctl status overview

james@james-Virtual-Machine:~$ sudo systemctl status
[sudo] password for james: 
● james-Virtual-Machine
    State: running
     Jobs: 0 queued
   Failed: 0 units
    Since: Mon 2016-09-05 10:14:51 CDT; 1min 46s ago
   CGroup: /
           ├─init.scope
           │ └─1 /sbin/init splash
           ├─system.slice
           │ ├─avahi-daemon.service
           │ │ ├─1722 avahi-daemon: running [james-Virtual-Machine.local
           │ │ └─1782 avahi-daemon: chroot helpe
           │ ├─dbus.service
           │ │ ├─1768 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
           │ │ └─3553 /usr/lib/x86_64-linux-gnu/fwupd/fwupd
           │ ├─ModemManager.service
           │ │ └─1913 /usr/sbin/ModemManager
           │ ├─cron.service
           │ │ └─1711 /usr/sbin/cron -f
           │ ├─postfix.service
           │ │ ├─3464 /usr/lib/postfix/sbin/master
           │ │ ├─3473 pickup -l -t unix -u -c
           │ │ └─3474 qmgr -l -t unix -u
           │ ├─lightdm.service
           │ │ ├─2080 /usr/sbin/lightdm
           │ │ └─2214 /usr/lib/xorg/Xorg -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswi
           │ ├─nginx.service
           │ │ ├─2250 nginx: master process /usr/sbin/nginx -g daemon on; master_process on
           │ │ └─2251 nginx: worker process                           
           │ ├─accounts-daemon.service
           │ │ └─1714 /usr/lib/accountsservice/accounts-daemon
           │ ├─colord.service
           │ │ └─2607 /usr/lib/colord/colord
           │ ├─systemd-journald.service
           │ │ └─801 /lib/systemd/systemd-journald
           │ ├─udisks2.service
           │ │ └─3514 /usr/lib/udisks2/udisksd --no-debug
           │ ├─upower.service
           │ │ └─2596 /usr/lib/upower/upowerd
           │ ├─systemd-timesyncd.service
           │ │ └─1108 /lib/systemd/systemd-timesyncd
           │ ├─cups.service
           │ │ ├─1716 /usr/sbin/cupsd -l
           │ │ ├─1903 /usr/lib/cups/notifier/dbus dbus:// 
           │ │ ├─1904 /usr/lib/cups/notifier/dbus dbus:// 
           │ │ ├─1905 /usr/lib/cups/notifier/dbus dbus:// 
           │ │ └─1906 /usr/lib/cups/notifier/dbus dbus:// 
           │ ├─systemd-logind.service
:q
james@james-Virtual-Machine:~$ 

Running machinectl

james@james-Virtual-Machine:~$ machinectl --uid=otsmanager shell
Connected to the local host. Press ^] three times within 1s to exit session.
$ systemctl --user status
● james-Virtual-Machine
    State: running
     Jobs: 0 queued
   Failed: 0 units
    Since: Mon 2016-09-05 10:14:53 CDT; 4min 8s ago
   CGroup: /user.slice/user-1001.slice/user@1001.service
           └─init.scope
             ├─2038 /lib/systemd/systemd --user
             └─2053 (sd-pam) 
$ systemctl --user start tfs
$ systemctl --user status
● james-Virtual-Machine
    State: running
     Jobs: 0 queued
   Failed: 0 units
    Since: Mon 2016-09-05 10:14:53 CDT; 5min ago
   CGroup: /user.slice/user-1001.slice/user@1001.service
           └─init.scope
             ├─2038 /lib/systemd/systemd --user
             └─2053 (sd-pam) 
DSpeichert commented 8 years ago

So is it indeed working when using machinectl instead of su?

jameswinegar commented 8 years ago

I can't launch the service under the user flag, but I am able to run systemctl based commands when using machinectl instead of su

DSpeichert commented 8 years ago

That is good. What do you mean by not being able to launch a service? Can you post output?

jameswinegar commented 8 years ago
$ systemctl --user start tfs
$ systemctl --user status
● james-Virtual-Machine
    State: running
     Jobs: 0 queued
   Failed: 0 units
    Since: Mon 2016-09-05 10:14:53 CDT; 5min ago
   CGroup: /user.slice/user-1001.slice/user@1001.service
           └─init.scope
             ├─2038 /lib/systemd/systemd --user
             └─2053 (sd-pam) 
DSpeichert commented 8 years ago

You should do systemctl --user status tfs or simply status tfs

jameswinegar commented 8 years ago
$journalctl --user --user-unit tfs
Sep 05 10:20:05 james-Virtual-Machine tfs[4168]: The Forgotten Server - Version 1.2
Sep 05 10:20:05 james-Virtual-Machine tfs[4168]: Compiled with GNU C++ version 5.4.0 20160609
Sep 05 10:20:05 james-Virtual-Machine tfs[4168]: Compiled on Sep  5 2016 09:52:24 for platform x64
Sep 05 10:20:05 james-Virtual-Machine tfs[4168]: A server developed by Mark Samman
Sep 05 10:20:05 james-Virtual-Machine tfs[4168]: Visit our forum for updates, support, and resources: http://otland.ne$
Sep 05 10:20:05 james-Virtual-Machine tfs[4168]: >> Loading config
Sep 05 10:20:05 james-Virtual-Machine tfs[4168]: >> Establishing database connection... MySQL 5.7.13
Sep 05 10:20:05 james-Virtual-Machine tfs[4168]: >> Running database manager
Sep 05 10:20:05 james-Virtual-Machine tfs[4168]: >> Loading vocations
Sep 05 10:20:05 james-Virtual-Machine tfs[4168]: >> Loading items
Sep 05 10:20:05 james-Virtual-Machine tfs[4168]: >> Loading script systems
Sep 05 10:20:05 james-Virtual-Machine systemd[2038]: tfs.service: Main process exited, code=killed, status=11/SEGV
Sep 05 10:20:05 james-Virtual-Machine systemd[2038]: tfs.service: Unit entered failed state.
Sep 05 10:20:05 james-Virtual-Machine systemd[2038]: tfs.service: Failed with result 'signal'.
Sep 05 10:20:05 james-Virtual-Machine systemd[2038]: tfs.service: Service hold-off time over, scheduling restart.
Sep 05 10:20:05 james-Virtual-Machine systemd[2038]: Stopped The Forgotten Server.
Sep 05 10:20:05 james-Virtual-Machine systemd[2038]: Started The Forgotten Server.
Sep 05 10:20:05 james-Virtual-Machine tfs[4175]: The Forgotten Server - Version 1.2
Sep 05 10:20:05 james-Virtual-Machine tfs[4175]: Compiled with GNU C++ version 5.4.0 20160609
Sep 05 10:20:05 james-Virtual-Machine tfs[4175]: Compiled on Sep  5 2016 09:52:24 for platform x64
Sep 05 10:20:05 james-Virtual-Machine tfs[4175]: A server developed by Mark Samman
Sep 05 10:20:05 james-Virtual-Machine tfs[4175]: Visit our forum for updates, support, and resources: http://otland.ne$
Sep 05 10:20:05 james-Virtual-Machine tfs[4175]: >> Loading config
Sep 05 10:20:05 james-Virtual-Machine tfs[4175]: >> Establishing database connection... MySQL 5.7.13
Sep 05 10:20:05 james-Virtual-Machine tfs[4175]: >> Running database manager
Sep 05 10:20:05 james-Virtual-Machine tfs[4175]: >> Loading vocations
Sep 05 10:20:05 james-Virtual-Machine tfs[4175]: >> Loading items
Sep 05 10:20:05 james-Virtual-Machine tfs[4175]: >> Loading script systems
Sep 05 10:20:05 james-Virtual-Machine systemd[2038]: tfs.service: Main process exited, code=killed, status=11/SEGV
Sep 05 10:20:05 james-Virtual-Machine systemd[2038]: tfs.service: Unit entered failed state.
Sep 05 10:20:05 james-Virtual-Machine systemd[2038]: tfs.service: Failed with result 'signal'.
Sep 05 10:20:06 james-Virtual-Machine systemd[2038]: tfs.service: Service hold-off time over, scheduling restart.
Sep 05 10:20:06 james-Virtual-Machine systemd[2038]: Stopped The Forgotten Server.
Sep 05 10:20:06 james-Virtual-Machine systemd[2038]: tfs.service: Start request repeated too quickly.
Sep 05 10:20:06 james-Virtual-Machine systemd[2038]: Failed to start The Forgotten Server.
DSpeichert commented 8 years ago

Are you sure your VM is not running out of RAM?

jameswinegar commented 8 years ago

Positive, allocated 4 CPUs and 4 GB of RAM as dedicated resource. Removed dynamic resource allocation and tried again, same issues. Currently using 1GB RAM and barely touching CPU resources.

Should I allocate more RAM? I can go up to 10 GB probably.

when trying to run the executable I get a seg fault (core dumped). Looking into the cause of this.

otsmanager@ubuntu:~/forgottenserver$ ./build/tfs
The Forgotten Server - Version 1.2
Compiled with GNU C++ version 5.4.0 20160609
Compiled on Sep  5 2016 18:58:14 for platform x64

A server developed by Mark Samman
Visit our forum for updates, support, and resources: http://otland.net/.

>> Loading config
>> Establishing database connection... MySQL 5.7.13
>> Running database manager
>> Loading vocations
>> Loading items
>> Loading script systems
Segmentation fault (core dumped)
jameswinegar commented 8 years ago

Same issue across SoftLayer, AWS, and Hyper-V (local). All 16.04

DSpeichert commented 8 years ago

Yup, that log above indicated a segfault. Many times the "killed" message as the last item in log means that OOM-killer was invoked because machine goes out of RAM. If it's not the case then it has to be some other problem with the source. Since it is starting to load, it's not an OS or systemd problem.

jameswinegar commented 8 years ago

Sounds good. I'll update if I find root cause.

On Sep 5, 2016, at 7:11 PM, Daniel Speichert notifications@github.com wrote:

Yup, that log above indicated a segfault. Many times the "killed" message as the last item in log means that OOM-killer was invoked because machine goes out of RAM. If it's not the case then it has to be some other problem with the source. Since it is starting to load, it's not an OS or systemd problem.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

DSpeichert commented 8 years ago

@jameswinegar Do you have any update on this?

jameswinegar commented 8 years ago

Work picked up a lot so side projects had to go away for now.

On Oct 21, 2016, at 2:45 PM, Daniel Speichert notifications@github.com wrote:

@jameswinegar Do you have any update on this?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.