0

I'm trying to set a custom port in my Systemd script, here is my .service file:

[Unit]
Description=discord-stock-ticker
Wants=basic.target
After=basic.target network.target
Before=sshd.service

[Service]
SyslogIdentifier=discord-stock-ticker
StandardOutput=syslog
StandardError=syslog
ExecReload=/bin/kill -HUP $MAINPID
ExecStart=/opt/discord-stock-ticker/discord-stock-ticker -port 42069
Restart=always

[Install]
WantedBy=multi-user.target

I've tried a bunch of different option like --PORT=xxx or --server.port=xxx, but it still run 8080 port.

s1ckoleg
  • 13
  • 4

1 Answers1

0

Did you run systemctl daemon-reload after editing the service file? You need to in order to "commit" the changes so to speak.

Glen Yu
  • 698
  • 1
  • 3
  • 9
  • Yes, but I just receive one more `discord-stock-ticker.service: Current command vanished from the unit file, execution of the command list won't be resumed.` message in `systemctl status discord-stock-ticker.service` – s1ckoleg Jan 25 '22 at 22:24
  • So what's the flag that's supposed to be passed to `discord-stock-ticker` to specify the port it's supposed to listen on? It looks like you're just trying random options that may not even exist for that binary. Another option you can do is run another service that forwards port 8080 to 42069 – Glen Yu Jan 26 '22 at 00:03
  • Oh, I see now, I thought that there is a universal flag for all binaries. Thank you! – s1ckoleg Jan 26 '22 at 00:15