Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing Port st2auth listens to without touching systemd service file #320

Open
rdancel001 opened this issue Jul 11, 2022 · 3 comments
Open

Comments

@rdancel001
Copy link

I noticed that the port that st2auth listens on is defined in st2.conf and in the systemd service file as a hardcoded value. I was wondering if it was possible to get the port number changes to something else, like 9105, before its setup as a service so that when the service is created, it'll reflect that new port?

Reason for the change is node_exporter uses 9100 to allow Prometheus to scrape the metrics from it. Installation of the exporter is done during our VM provisioning process so its something that would be less likely to change.

I'd like to avoid directly modifying the systemd file, if possible.

@amanda11
Copy link
Contributor

@nzlosh Is the port that is in the systemd service file relevant any more (ST2 3.7 onwards)? I thought the value in st2.conf was the only value now needed to be changed, but the systemd file still shows:

# cat /usr/lib/systemd/system/st2auth.service 
[Unit]
Description=StackStorm service st2auth
After=network.target st2auth.socket
Requires=st2auth.socket

[Service]
Type=simple
User=st2
Group=st2
Environment="DAEMON_ARGS=-k eventlet -b 127.0.0.1:9100 --workers 1 --threads 1 --graceful-timeout 10 --timeout 30 --log-config /etc/st2/logging.auth.gunicorn.conf --error-logfile /var/log/st2/st2auth.log"
EnvironmentFile=-/etc/sysconfig/st2auth
ExecStart=/opt/stackstorm/st2/bin/gunicorn st2auth.wsgi:application $DAEMON_ARGS
TimeoutSec=60
PrivateTmp=true
Restart=on-failure
RestartSec=5

But if I change st2.conf to use a different port, the systemd file is unchanged, but it does indeed listen on the port that is specified in st2.conf.

So I'm wondering if for @rdancel001's query he can ignore the value in the systemd file, and just needs to configure the port in st2.conf now. And perhaps we have a tidy-up issue that we have the bind address in the DAEMON_ARGS in the systemd file?

@nzlosh
Copy link

nzlosh commented Jul 14, 2022

After looking into this further, it appears the service files will need to be automatically generated too, I'll prepare a patch next week when I return from holiday.

@rdancel001
Copy link
Author

Sweet! I'm appreciative for the quick response and clarification. I'll test it out and verify as well on my end when I get the chance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants