Run caddy as a systemd service on a desktop computer (fedora)

I have a problem very similar to this one. At least, the error message printed by systemd is just the same:

# journalctl -f -u caddy.service
-- Logs begin at mer 2015-11-25 11:23:31 CET. --
apr 10 14:33:12 localhost.localdomain systemd[1]: Started Caddy HTTP/2 web server.
apr 10 14:33:12 localhost.localdomain systemd[1]: caddy.service: Main process exited, code=exited, status=203/EXEC
apr 10 14:33:12 localhost.localdomain systemd[1]: caddy.service: Unit entered failed state.
apr 10 14:33:12 localhost.localdomain systemd[1]: caddy.service: Failed with result 'exit-code'.
apr 10 14:33:13 localhost.localdomain systemd[1]: caddy.service: Service hold-off time over, scheduling restart.
apr 10 14:33:13 localhost.localdomain systemd[1]: Stopped Caddy HTTP/2 web server.
apr 10 14:33:13 localhost.localdomain systemd[1]: caddy.service: Start request repeated too quickly.
apr 10 14:33:13 localhost.localdomain systemd[1]: Failed to start Caddy HTTP/2 web server.
apr 10 14:33:13 localhost.localdomain systemd[1]: caddy.service: Unit entered failed state.
apr 10 14:33:13 localhost.localdomain systemd[1]: caddy.service: Failed with result 'start-limit-hit'.

In the other thread it seems that this error was caused by a wrong Caddyfile. However, this doesn’t seem to be the case for me, as caddy runs just fine if I launch it from a terminal.

Basically I followed the tutorial in dist/init/linux-systemd. But I let run caddy as my own user:

# cat /etc/systemd/system/caddy.service | grep -A 2 User
; User and group the process will run as.
User=fede
Group=fede

Is it a bad thing?
I’m setting it up on my computer to test caddy locally, before trying to set it up on a server.

Where could I search for more information? No result from this:

# grep -i caddy /var/log/lastlog 
[~]# 

Thanks in advance

1 Like

Hmm!

Would you mind posting your final unit file (even if it’s 99% the same), your Caddyfile, and the exact command you’re running in the shell to start Caddy when it’s working?

It’s not following accepted practices, but it should have no impact on functionality as long as your user has appropriate permissions (to the Caddyfile for example). I doubt there’s an issue with that.

Here’s what I do to run it manually in the shell:

$ cd /etc/caddy/
[caddy]$ caddy
Activating privacy features... done.
http://localhost
WARNING: File descriptor limit 1024 is too low for production servers. At least 8192 is recommended. Fix with "ulimit -n 8192".

Even the command in the caddy.service file works fine if launched manually:

$ /usr/local/bin/caddy -log stdout -agree=true -conf=/etc/caddy/Caddyfile -root=/home/fede/web
Activating privacy features... done.
http://localhost
2017/04/11 09:11:19 http://localhost
WARNING: File descriptor limit 1024 is too low for production servers. At least 8192 is recommended. Fix with "ulimit -n 8192".

Here’s my full caddy.service file:

# cat /etc/systemd/system/caddy.service 
[Unit]
Description=Caddy HTTP/2 web server
Documentation=https://caddyserver.com/docs
After=network-online.target
Wants=network-online.target systemd-networkd-wait-online.service

[Service]
Restart=on-failure
StartLimitInterval=86400
StartLimitBurst=5

; User and group the process will run as.
User=fede
Group=fede

; Letsencrypt-issued certificates will be written to this directory.
Environment=CADDYPATH=/etc/ssl/caddy

; Always set "-root" to something safe in case it gets forgotten in the Caddyfile.
ExecStart=/usr/local/bin/caddy -log stdout -agree=true -conf=/etc/caddy/Caddyfile -root=/home/fede/web
ExecReload=/bin/kill -USR1 $MAINPID

; Limit the number of file descriptors; see `man systemd.exec` for more limit settings.
LimitNOFILE=1048576
; Unmodified caddy is not expected to use more than that.
LimitNPROC=64

; Use private /tmp and /var/tmp, which are discarded after caddy stops.
PrivateTmp=true
; Use a minimal /dev
PrivateDevices=true
; Hide /home, /root, and /run/user. Nobody will steal your SSH-keys.
ProtectHome=true
; Make /usr, /boot, /etc and possibly some more folders read-only.
ProtectSystem=full
; … except /etc/ssl/caddy, because we want Letsencrypt-certificates there.
;   This merely retains r/w access rights, it does not add any new. Must still be writable on the host!
ReadWriteDirectories=/etc/ssl/caddy

; The following additional security directives only work with systemd v229 or later.
; They further retrict privileges that can be gained by caddy. Uncomment if you like.
; Note that you may have to add capabilities required by any plugins in use.
;CapabilityBoundingSet=CAP_NET_BIND_SERVICE
;AmbientCapabilities=CAP_NET_BIND_SERVICE
;NoNewPrivileges=true

[Install]
WantedBy=multi-user.target
1 Like

The execute flag is not set for the user who tries to run caddy. Or its for the wrong architecture. If a manual start succeeds, check whether you have more than one copy of the caddy binary.

Run this:

which caddy
find / -name 'caddy' -type f

# on every binary
stat /usr/local/bin/caddy
getfacl /usr/local/bin/caddy

… and try to spot if caddy's permissions are set to 0755.

No, that’s excellent. Exactly how you run daemons on a server. (nobody:nogroup and similar are okay, too.)

A professional admin/ops will setup some kind of additional isolation. Docker or rkt are the easiest, and systemd has built-in facilities.

You found it. journalctl is the way to go. I sometimes check output of dmesg, too.

If on a server you might want to take a look at remote logging.

Uncomment the latter.

I’m now testing on my laptop, but I get the same error I had on my desktop.
There’s only one caddy executable and it can be executed by any user:

[~]$ which -a  caddy
/usr/local/bin/caddy
[~]$ ls -l /usr/local/bin/caddy 
-rwxr-xr-x 1 root root 27762846 20 feb 22.30 /usr/local/bin/caddy

I tried also uncommenting NoNewPrivileges=true, but that does not change anything (in case you recommend it to solve this problem).

When I run systemctl start caddy (as root, otherwise an authentication dialog will pop up), in journalctl I see the following lines:

apr 17 19:14:09 fedora sudo[4150]: pam_unix(sudo:session): session opened for user root by (uid=0)
apr 17 19:14:09 fedora systemd[1]: Network Service is not active.
apr 17 19:14:09 fedora systemd[1]: Dependency failed for Wait for Network to be Configured.
-- Subject: L'unità systemd-networkd-wait-online.service è fallita
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- L'unità systemd-networkd-wait-online.service è fallita.
-- 
-- Il risultato è dependency.
apr 17 19:14:09 fedora systemd[1]: systemd-networkd-wait-online.service: Job systemd-networkd-wait-online.service/start failed with result 'dependency'.
apr 17 19:14:09 fedora systemd[1]: caddy.service: Start request repeated too quickly.
apr 17 19:14:09 fedora systemd[1]: Failed to start Caddy HTTP/2 web server.
-- Subject: L'unità caddy.service è fallita
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- L'unità caddy.service è fallita.
-- 
-- Il risultato è failed.

Perhaps it depends on one of these two services.

systemd-networkd-wait-online.service:

$ systemctl status systemd-networkd-wait-online.service
● systemd-networkd-wait-online.service - Wait for Network to be Configured
   Loaded: loaded (/usr/lib/systemd/system/systemd-networkd-wait-online.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:systemd-networkd-wait-online.service(8)

apr 17 18:57:17 fedora systemd[1]: Dependency failed for Wait for Network to be Configured.
apr 17 18:57:17 fedora systemd[1]: systemd-networkd-wait-online.service: Job systemd-networkd-wait-online.service/start failed with result 'dependency'.
apr 17 18:57:17 fedora systemd[1]: Dependency failed for Wait for Network to be Configured.
apr 17 18:57:17 fedora systemd[1]: systemd-networkd-wait-online.service: Job systemd-networkd-wait-online.service/start failed with result 'dependency'.
apr 17 18:57:17 fedora systemd[1]: Dependency failed for Wait for Network to be Configured.
apr 17 18:57:17 fedora systemd[1]: systemd-networkd-wait-online.service: Job systemd-networkd-wait-online.service/start failed with result 'dependency'.
apr 17 19:04:33 fedora systemd[1]: Dependency failed for Wait for Network to be Configured.
apr 17 19:04:33 fedora systemd[1]: systemd-networkd-wait-online.service: Job systemd-networkd-wait-online.service/start failed with result 'dependency'.
apr 17 19:14:09 fedora systemd[1]: Dependency failed for Wait for Network to be Configured.
apr 17 19:14:09 fedora systemd[1]: systemd-networkd-wait-online.service: Job systemd-networkd-wait-online.service/start failed with result 'dependency'.

NetworkManager-wait-online.service:

$ systemctl status NetworkManager-wait-online.service
● NetworkManager-wait-online.service - Network Manager Wait Online
   Loaded: loaded (/usr/lib/systemd/system/NetworkManager-wait-online.service; disabled; vendor preset: disabled)
   Active: active (exited) since lun 2017-04-17 18:37:55 CEST; 43min ago
     Docs: man:nm-online(1)
 Main PID: 920 (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/NetworkManager-wait-online.service

apr 17 18:37:54 fedora systemd[1]: Starting Network Manager Wait Online...
apr 17 18:37:55 fedora systemd[1]: Started Network Manager Wait Online.

Sorry for the noise: the network problem was already solved in this thread.
So I simply changed caddy.service from this:

 Wants=network-online.target systemd-networkd-wait-online.service

to this:

Wants=network-online.target networkmanager-wait-online.service

Now the service starts correctly but the file cannot be executed. This is the topic of this thread.
Sorry, logs are in italian but I hope you can get it:

-- La fase di avvio è done.
apr 17 19:29:15 fedora audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=caddy comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
apr 17 19:29:15 fedora systemd[4515]: caddy.service: Failed at step EXEC spawning /usr/local/bin/caddy: Resource temporarily unavailable
-- Subject: Il processo /usr/local/bin/caddy non può essere eseguito
-- Defined-By: systemd

Other useful information, I hope.
After uncommenting these three lines (as suggested here):

CapabilityBoundingSet=CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=true

and a reboot, the unit starts successfully until I try to open localhost in my browser:

[~]$ systemctl status caddy
● caddy.service - Caddy HTTP/2 web server
   Loaded: loaded (/etc/systemd/system/caddy.service; enabled; vendor preset: disabled)
   Active: active (running) since lun 2017-04-17 21:09:33 CEST; 15min ago
     Docs: https://caddyserver.com/docs
 Main PID: 1101 (caddy)
    Tasks: 7 (limit: 4915)
   CGroup: /system.slice/caddy.service
           └─1101 /usr/local/bin/caddy -log stdout -agree=true -conf=/etc/caddy/Caddyfile -root=/home/fede/public_html

apr 17 21:09:33 fedora systemd[1]: Started Caddy HTTP/2 web server.
apr 17 21:09:33 fedora caddy[1101]: Activating privacy features... done.
apr 17 21:09:33 fedora caddy[1101]: http://
apr 17 21:09:33 fedora caddy[1101]: 2017/04/17 21:09:33 http://
[~]$ 
[~]$ systemctl status caddy
● caddy.service - Caddy HTTP/2 web server
   Loaded: loaded (/etc/systemd/system/caddy.service; enabled; vendor preset: disabled)
   Active: failed (Result: start-limit-hit) since lun 2017-04-17 21:25:08 CEST; 10s ago
     Docs: https://caddyserver.com/docs
  Process: 3735 ExecStart=/usr/local/bin/caddy -log stdout -agree=true -conf=/etc/caddy/Caddyfile -root=/home/fede/public_html (code=exited, status=203/EXEC)
 Main PID: 3735 (code=exited, status=203/EXEC)

apr 17 21:25:08 fedora systemd[1]: caddy.service: Unit entered failed state.
apr 17 21:25:08 fedora systemd[1]: caddy.service: Failed with result 'exit-code'.
apr 17 21:25:08 fedora systemd[1]: caddy.service: Service hold-off time over, scheduling restart.
apr 17 21:25:08 fedora systemd[1]: Stopped Caddy HTTP/2 web server.
apr 17 21:25:08 fedora systemd[1]: caddy.service: Start request repeated too quickly.
apr 17 21:25:08 fedora systemd[1]: Failed to start Caddy HTTP/2 web server.
apr 17 21:25:08 fedora systemd[1]: caddy.service: Unit entered failed state.
apr 17 21:25:08 fedora systemd[1]: caddy.service: Failed with result 'start-limit-hit'.

I’m now testing again on my desktop computer (same Fedora 25 as on my laptop), where I tried a different configuration which works fine: caddy service starts fine and keeps working while I browse localhost.
I’m running caddy as user www-data and it works either with caddy root on /var/www or on /home/USER/www.

Tonight I’ll double-check on my laptop if there are permission issues.

Unfortunately it looks like I have the same problem :sob: although I’m running Ubuntu 17.04 on Linode:

adrian@toolbox:~$ uname -a
Linux toolbox 4.9.15-x86_64-linode81 #1 SMP Fri Mar 17 09:47:36 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux

adrian@toolbox:~$ systemd --version
systemd 232
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN

My caddy.service is basically a copy -> paste from GitHub, except that I’ve uncommented the last three parameters, as recommended for newer systemd:

adrian@toolbox:~$ cat /etc/systemd/system/caddy.service
[Unit]
Description=Caddy HTTP/2 web server
Documentation=https://caddyserver.com/docs
After=network-online.target
Wants=network-online.target systemd-networkd-wait-online.service

[Service]
Restart=on-failure
StartLimitInterval=86400
StartLimitBurst=5

; User and group the process will run as.
User=www-data
Group=www-data

; Letsencrypt-issued certificates will be written to this directory.
Environment=CADDYPATH=/etc/ssl/caddy

; Always set "-root" to something safe in case it gets forgotten in the Caddyfile.
ExecStart=/usr/local/bin/caddy -log stdout -agree=true -conf=/etc/caddy/Caddyfile -root=/var/tmp
ExecReload=/bin/kill -USR1 $MAINPID

; Limit the number of file descriptors; see `man systemd.exec` for more limit settings.
LimitNOFILE=1048576
; Unmodified caddy is not expected to use more than that.
LimitNPROC=64

; Use private /tmp and /var/tmp, which are discarded after caddy stops.
PrivateTmp=true
; Use a minimal /dev
PrivateDevices=true
; Hide /home, /root, and /run/user. Nobody will steal your SSH-keys.
ProtectHome=true
; Make /usr, /boot, /etc and possibly some more folders read-only.
ProtectSystem=full
; … except /etc/ssl/caddy, because we want Letsencrypt-certificates there.
;   This merely retains r/w access rights, it does not add any new. Must still be writable on the host!
ReadWriteDirectories=/etc/ssl/caddy

; The following additional security directives only work with systemd v229 or later.
; They further retrict privileges that can be gained by caddy. Uncomment if you like.
; Note that you may have to add capabilities required by any plugins in use.
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=true

[Install]
WantedBy=multi-user.target

I only have one caddy binary with (I think) proper permissions:

adrian@toolbox:~$ which -a  caddy
/usr/local/bin/caddy

adrian@toolbox:~$ ls -hal /usr/local/bin/caddy
-rwxr-xr-x 1 root root 5.1M May 21 16:33 /usr/local/bin/caddy

adrian@toolbox:~$ stat /usr/local/bin/caddy
  File: /usr/local/bin/caddy
  Size: 5322619   	Blocks: 10400      IO Block: 4096   regular file
Device: 800h/2048d	Inode: 1995        Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2017-05-21 16:33:24.879306395 +0200
Modify: 2017-05-21 16:33:24.885973064 +0200
Change: 2017-05-21 19:03:29.376648819 +0200
 Birth: -

Folders for storing configuration and SSL certificates should also be set up properly, although they shouldn’t matter here because it doesn’t look like Caddy gets to the point it can use them:

adrian@toolbox:~$ stat /etc/caddy
  File: /etc/caddy
  Size: 4096      	Blocks: 8          IO Block: 4096   directory
Device: 800h/2048d	Inode: 486893      Links: 2
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (   33/www-data)
Access: 2017-05-21 19:12:10.356399795 +0200
Modify: 2017-05-21 18:15:12.683364771 +0200
Change: 2017-05-21 19:03:38.886684979 +0200
 Birth: -

adrian@toolbox:~$ stat /etc/ssl/caddy
  File: /etc/ssl/caddy
  Size: 4096      	Blocks: 8          IO Block: 4096   directory
Device: 800h/2048d	Inode: 486894      Links: 2
Access: (0770/drwxrwx---)  Uid: (   33/www-data)   Gid: (    0/    root)
Access: 2017-05-22 19:11:09.240680874 +0200
Modify: 2017-05-21 16:21:15.485636515 +0200
Change: 2017-05-21 19:03:53.363408381 +0200
 Birth: -

The www-data user should be configured properly (it has been automatically added by the system). Relevant snippets from /etc/passwd and /etc/group:

adrian@toolbox:~$ cat /etc/passwd
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin

adrian@toolbox:~$ cat /etc/group
www-data:x:33:

I saw that systemd-networkd-wait-online.service had a problem with a dependency, so I’ve manually started and enabled systemd-networkd and it’s working now as it should.

Nevertheless, even after a reboot caddy.service does not work:

adrian@toolbox:~$ sudo systemctl status caddy.service
● caddy.service - Caddy HTTP/2 web server
   Loaded: loaded (/etc/systemd/system/caddy.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2017-05-22 19:11:19 CEST; 12min ago
     Docs: https://caddyserver.com/docs
  Process: 3588 ExecStart=/usr/local/bin/caddy -log stdout -agree=true -conf=/etc/caddy/Caddyfile -root=/var/tmp (code=exited, status=203/EXEC)
 Main PID: 3588 (code=exited, status=203/EXEC)

May 22 19:11:19 toolbox systemd[1]: caddy.service: Main process exited, code=exited, status=203/EXEC
May 22 19:11:19 toolbox systemd[1]: caddy.service: Unit entered failed state.
May 22 19:11:19 toolbox systemd[1]: caddy.service: Failed with result 'exit-code'.
May 22 19:11:19 toolbox systemd[1]: caddy.service: Service hold-off time over, scheduling restart.
May 22 19:11:19 toolbox systemd[1]: Stopped Caddy HTTP/2 web server.
May 22 19:11:19 toolbox systemd[1]: caddy.service: Start request repeated too quickly.
May 22 19:11:19 toolbox systemd[1]: Failed to start Caddy HTTP/2 web server.
May 22 19:11:19 toolbox systemd[1]: caddy.service: Unit entered failed state.
May 22 19:11:19 toolbox systemd[1]: caddy.service: Failed with result 'exit-code'.

Any suggestions would be much appreciated :smiley_cat:

Hi @adrianz,

I don’t really use 17.04 yet (last time I gave it a shot, it wasn’t supported by Docker, heh). But I set up a quick VPS to run through this.

Here’s what I did:

  1. Spin up a VPS on Vultr with Ubuntu 17.04, 25GB size tier
  2. curl https://getcaddy.com | bash
  3. mkdir /etc/caddy /etc/ssl/caddy
  4. curl "https://raw.githubusercontent.com/mholt/caddy/master/dist/init/linux-systemd/caddy.service" -o /etc/systemd/system/caddy.service
  5. nano /etc/systemd/system/caddy.service
    -Uncommenting CapabilityBoundingSet=CAP_NET_BIND_SERVICE, AmbientCapabilities=CAP_NET_BIND_SERVICE, and NoNewPrivileges=true
    -Commenting ;PrivateTmp=true to fix a namespace issue (/tmp and /var/tmp issues; didn’t work this out yet)
  6. echo -e ":80\nstatus 200 /" > /etc/caddy/Caddyfile
  7. systemctl enable caddy && systemctl start caddy

Good result:

root@tiamat:~# systemctl status caddy
● caddy.service - Caddy HTTP/2 web server
   Loaded: loaded (/etc/systemd/system/caddy.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2017-05-23 07:29:32 UTC; 3min 6s ago
     Docs: https://caddyserver.com/docs
 Main PID: 4847 (caddy)
      CPU: 12ms
   CGroup: /system.slice/caddy.service
           └─4847 /usr/local/bin/caddy -log stdout -agree=true -conf=/etc/caddy/Caddyfile -root=/var/

May 23 07:29:32 tiamat systemd[1]: Started Caddy HTTP/2 web server.
May 23 07:29:32 tiamat caddy[4847]: Activating privacy features... done.
May 23 07:29:32 tiamat caddy[4847]: http://
May 23 07:29:32 tiamat caddy[4847]: 2017/05/23 07:29:32 http://
lines 1-13/13 (END)
root@tiamat:~# curl -i localhost
HTTP/1.1 200 OK
Server: Caddy
Date: Tue, 23 May 2017 07:32:50 GMT
Content-Length: 0
Content-Type: text/plain; charset=utf-8

root@tiamat:~#

@fedelibre One thing I noticed is that your unit file specifies ProtectHome=true which makes systemd hide the /home directory from the service.

I would imagine this clashes with your Caddy option of -root=/home/fede/web and thus prevents Caddy from starting.

@jinks thanks, but actually I commented that line and nothing changed. I also tried to change the web root to /var/www with no success.
I’ll try again everything from scratch as soon as I have some spare time.

I tried to completely resetup my caddy server like @Whitestrake did, but on Debian 8. Resulting in no change. I had to keep AmbientCapabilities commented, because my systemd doesn’t support it, but I set those already for the caddy executable (with sudo setcap 'cap_net_bind_service=+ep' /usr/local/bin/caddy). My system is set up by using the preconfigured directories. I also tried to disable some of the other security features like home folder protection, but didn’t change a thing.

Also everything worked until I restarted the service today. Could have a systemd update caused this error?

Since today I’m getting this (very similar) error all the time:

● caddy.service - Caddy HTTP/2 web server
   Loaded: loaded (/etc/systemd/system/caddy.service; enabled)
   Active: failed (Result: start-limit) since Di 2017-06-06 04:21:02 CEST; 2s ago
     Docs: https://caddyserver.com/docs
  Process: 2066 ExecStart=/usr/local/bin/caddy -log stdout -agree=true -conf=/etc/caddy/Caddyfile -root=/var/tmp (code=exited, status=203/EXEC)
 Main PID: 2066 (code=exited, status=203/EXEC)

Jun 06 04:21:02 seyfahni.de systemd[1]: caddy.service holdoff time over, scheduling restart.
Jun 06 04:21:02 seyfahni.de systemd[1]: Stopping Caddy HTTP/2 web server...
Jun 06 04:21:02 seyfahni.de systemd[1]: Starting Caddy HTTP/2 web server...
Jun 06 04:21:02 seyfahni.de systemd[1]: caddy.service start request repeated too quickly, refusing to start.
Jun 06 04:21:02 seyfahni.de systemd[1]: Failed to start Caddy HTTP/2 web server.
Jun 06 04:21:02 seyfahni.de systemd[1]: Unit caddy.service entered failed state.

journalctl -u caddy isn’t helpful either:

Jun 06 04:21:02 seyfahni.de systemd[1]: Starting Caddy HTTP/2 web server...
Jun 06 04:21:02 seyfahni.de systemd[1]: Started Caddy HTTP/2 web server.
Jun 06 04:21:02 seyfahni.de systemd[2066]: Failed at step EXEC spawning /usr/local/bin/caddy: Resource temporarily un
Jun 06 04:21:02 seyfahni.de systemd[1]: caddy.service: main process exited, code=exited, status=203/EXEC
Jun 06 04:21:02 seyfahni.de systemd[1]: Unit caddy.service entered failed state.
Jun 06 04:21:02 seyfahni.de systemd[1]: caddy.service holdoff time over, scheduling restart.
Jun 06 04:21:02 seyfahni.de systemd[1]: Stopping Caddy HTTP/2 web server...
Jun 06 04:21:02 seyfahni.de systemd[1]: Starting Caddy HTTP/2 web server...
Jun 06 04:21:02 seyfahni.de systemd[1]: caddy.service start request repeated too quickly, refusing to start.
Jun 06 04:21:02 seyfahni.de systemd[1]: Failed to start Caddy HTTP/2 web server.
Jun 06 04:21:02 seyfahni.de systemd[1]: Unit caddy.service entered failed state.

Eventually I decided to keep it simple and use an autostart file (on my desktop computer). I’ll do new experiments with systemd as soon as I install caddy on the server.

Here’s my ~/.config/autostart/caddy.desktop:

[Desktop Entry]
Type=Application
Name=Caddy
Exec=nohup caddy -conf /etc/caddy/Caddyfile

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.