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

wrong systemd location on atomic hosts #163

Open
sgohl opened this issue Feb 20, 2025 · 0 comments
Open

wrong systemd location on atomic hosts #163

sgohl opened this issue Feb 20, 2025 · 0 comments

Comments

@sgohl
Copy link

sgohl commented Feb 20, 2025

I am using Fedora CoreOS where /usr/lib/systemd is a readonly filesystem.

Hence, the install script fails

curl -o- http://192.168.55.191:12345/serverStatus/clnzoxcy10001vy2ohi4obbi0/install.sh?url=http://192.168.55.191:12345 | sudo bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4185  100  4185    0     0   371k      0 --:--:-- --:--:-- --:--:--  408k
main: line 40: yum: command not found
[Info] Please input server url, press enter use default value(default: http://192.168.55.191:12345)
[Info] Please input workspaceId, press enter use default value(default: clnzoxcy10001vy2ohi4obbi0)
[Info] Downloading amd64 binary file...
WARNING: The certificate is NOT trusted. The certificate issuer is unknown. 
WARNING: The certificate is NOT trusted. The certificate issuer is unknown. 
tianji-reporter-linu 100% [=========================================================================================================================>]   12.06M   59.46MB/s
                          [Files: 1  Bytes: 12.06M [10.04MB/s] Redirects: 2  Todo: 0  Errors: 0                                                      ]
[Info] Write to systemd configuration
main: line 71: /usr/lib/systemd/system/tianji-reporter.service: Read-only file system
Failed to enable unit: Unit file tianji-reporter.service does not exist.
Failed to start tianji-reporter.service: Unit tianji-reporter.service not found.
[Error] Tianji Reporter Start Failed!

If I change line 67 to

service_conf=/etc/systemd/system/tianji-reporter.service

it works and I see the server and metrics in tianji.

I'd like to suggest adding a check whether /usr/lib/systemd is writeable and in case it's not, use /etc/systemd

if [[ -w /usr/lib/systemd ]]
then
  service_conf=/usr/lib/systemd/system/tianji-reporter.service
else
  service_conf=/etc/systemd/system/tianji-reporter.service
fi
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

1 participant