dokku / dokku-pro-issues

Temporary location for issues with installing or using dokku pro
0 stars 0 forks source link

Support running dokku-pro on server restart #11

Open gamedevsam opened 1 year ago

gamedevsam commented 1 year ago

Description of feature

I've had to take a server offline a couple of times, and having to restart the services manually is annoying. Can we expose a setting to start the services on boot?

josegonzalez commented 1 year ago

This is strange, that should already be starting on boot via systemd. Can you run systemctl status dokku-pro?

gamedevsam commented 1 year ago
root@ubuntu-s-1vcpu-1gb-nyc1-01:~# systemctl status dokku-pro
● dokku-pro.service - web process for dokku-pro
     Loaded: loaded (/etc/systemd/system/dokku-pro.service; static)
     Active: active (running) since Tue 2023-04-11 06:01:05 UTC; 1 day 21h ago
    Process: 194349 ExecStartPre=/usr/bin/mkdir -p /var/lib/dokku/data/pro/db (code=exited, status=0/SUCCESS)
   Main PID: 194350 (dokku-pro)
      Tasks: 11 (limit: 1116)
     Memory: 45.8M
        CPU: 16min 32.225s
     CGroup: /system.slice/dokku-pro.service
             └─194350 /usr/bin/dokku-pro server

Looks like the service comes up, but not the target:

root@ubuntu-s-1vcpu-1gb-nyc1-01:~# systemctl status dokku-target
Unit dokku-target.service could not be found.

That's probably the cause of the issue.

josegonzalez commented 1 year ago

I don't think thats what the target is called. Try this to list the targets:

systemctl list-units --type target
gamedevsam commented 1 year ago
root@ubuntu-s-1vcpu-1gb-nyc1-01:~# systemctl list-units --type target
  UNIT                        LOAD   ACTIVE SUB    DESCRIPTION                        
  basic.target                loaded active active Basic System
  cloud-config.target         loaded active active Cloud-config availability
  cloud-init.target           loaded active active Cloud-init target
  cryptsetup.target           loaded active active Local Encrypted Volumes
  dokku-event-listener.target loaded active active dokku-event-listener.target
  dokku-pro.target            loaded active active dokku-pro.target
  getty-pre.target            loaded active active Preparation for Logins
  getty.target                loaded active active Login Prompts
  graphical.target            loaded active active Graphical Interface
  local-fs-pre.target         loaded active active Preparation for Local File Systems
  local-fs.target             loaded active active Local File Systems
  multi-user.target           loaded active active Multi-User System
  network-online.target       loaded active active Network is Online
  network-pre.target          loaded active active Preparation for Network
  network.target              loaded active active Network
  nss-lookup.target           loaded active active Host and Network Name Lookups
  paths.target                loaded active active Path Units
  remote-fs-pre.target        loaded active active Preparation for Remote File Systems
  remote-fs.target            loaded active active Remote File Systems
  slices.target               loaded active active Slice Units
  snapd.mounts-pre.target     loaded active active Mounting snaps
  snapd.mounts.target         loaded active active Mounted snaps
  sockets.target              loaded active active Socket Units
  swap.target                 loaded active active Swaps
  sysinit.target              loaded active active System Initialization
  time-set.target             loaded active active System Time Set
  timers.target               loaded active active Timer Units
  veritysetup.target          loaded active active Local Verity Protected Volumes

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.
28 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
gamedevsam commented 1 year ago

I restarted my server, and when I tried to access dokku pro I saw this:

Screenshot from 2023-04-13 00-13-09

Until I ran sudo systemctl start dokku-pro.target and it became accessible.

josegonzalez commented 1 year ago

What is the output of:

sudo systemctl status dokku-pro.target
gamedevsam commented 1 year ago
root@ubuntu-s-1vcpu-1gb-nyc1-01:~# sudo systemctl status dokku-pro.target
● dokku-pro.target
     Loaded: loaded (/etc/systemd/system/dokku-pro.target; disabled; vendor preset: enabled)
     Active: active since Thu 2023-04-13 04:13:34 UTC; 17h ago

Apr 13 04:13:34 ubuntu-s-1vcpu-1gb-nyc1-01 systemd[1]: Reached target dokku-pro.target.
conscribtor commented 1 year ago

@gamedevsam I just discovered this thread, but maybe this is still useful to you or others:

Your target is not enabled.

irion@prtl:~$ sudo systemctl status dokku-pro.target
● dokku-pro.target
     Loaded: loaded (/etc/systemd/system/dokku-pro.target; >>enabled<<; vendor preset: enabled)
     Active: active since Mon 2023-08-28 21:14:25 UTC; 5min ago

Aug 28 21:14:25 prtl.switch.ch systemd[1]: Reached target dokku-pro.target.

If you run sudo systemctl enable dokku-pro.target, your issue should be solved after a reboot.

@josegonzalez The documentation on getting-started/installation and operating/general does not mention the need to install the target. Can I contribute improvements and change proposals to the documentation somehow? I can't seem to find the Dokku Pro documentation repository.

gamedevsam commented 1 year ago

Ohhh, most excellent, thank you so much (I'm learning Linux at the same time as I'm learning Dokku). I think opening a PR to update the getting started docs would be much appreciated!