So I am trying to do one simple thing: starting Caddy at boot.
I have tried various methods over the last 5 hours to get this done. But I simply can’t…
I have seen that there is a caddy.service to run caddy at boot. I completely followed the tutorial and it worked in principle… BUT I have to give caddy my Godaddy API Key when starting and I don’t know how to do that with that service…
So then I created a script to run caddy:
#!/bin/bash
cd /usr/local/bin
ulimit -n 8192
exec nohup sudo GODADDY_API_KEY=dLddddddd GODADDY_API_SECRET=8Gxxxxxxxxx caddy -log caddylog.log &
The script itself works! I just have to type sudo bash /usr/local/bin/startcaddy.sh
and it is up and running.
But then I tried to run it at startup… And none of those methods worked:
- call it via /etc/rc.local
- create my own caddy.service in /etc/init.d which then calls the script
- create another script in /etc/init which calls the script
- trying to modify the original caddy.service to start my script
- creating a cronjob with @reboot paramter
- creating a cronjob which runs every 5 minutes
I am seriously out of ideas… And I am also kind of pissed rn… I did put so much time already into setting up caddy and at every personal milestone I run into problems… Am I this dumb?