msgbyte / msgbyte/tianji

wrong systemd location on atomic hosts

Open
#163 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
3.1k
Forks
194
Avg merge
18m
Merged PRs (30d)
3

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the install script around line 67, where the systemd service configuration path is selected, and review the subsequent enable and start steps. Reproduce the installation on Fedora CoreOS or another host with a read-only /usr/lib/systemd, then verify that the service is written to a usable systemd location and starts successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, shell
Domain
infrastructure
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.