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

Dropins wrong file permissions #1833

Closed
quentin9696 opened this issue Mar 11, 2024 · 4 comments
Closed

Dropins wrong file permissions #1833

quentin9696 opened this issue Mar 11, 2024 · 4 comments
Labels
jira for syncing to jira

Comments

@quentin9696
Copy link

Bug

Operating System Version

39.20240210.3.0 (CoreOS)

Ignition Version

2.17.0

Environment

AWS

Expected Behavior

Systemd dropins files must be created with permissions 644

Actual Behavior

Systemd dropins files are created with 700

This produce those warnings

is marked executable. Please remove executable permission bits. Proceeding anyway.
is marked world-inaccessible. This has no effect as configuration data is accessible via APIs without restrictions. Proceeding anyway.

Reproduction Steps

  1. Start a new FCOS with a systemd dropin
  2. Check the unit logs

Other Information

N/A

@jmarrero jmarrero added the jira for syncing to jira label Mar 11, 2024
@HuijingHei
Copy link
Member

Thanks for the reports!

Try to test on 39.20240309.20.0, but can not reproduce this, the new created systemd files has permissions 644, could you help to confirm? Thanks!

core@ip-10-0-140-237:~$ systemctl status hello.service
● hello.service
     Loaded: loaded (/etc/systemd/system/hello.service; enabled; preset: enabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: active (exited) since Tue 2024-03-12 03:08:31 UTC; 17s ago
    Process: 1586 ExecStart=/usr/bin/echo hello (code=exited, status=0/SUCCESS)
   Main PID: 1586 (code=exited, status=0/SUCCESS)
        CPU: 1ms

Mar 12 03:08:31 ip-10-0-140-237 systemd[1]: Starting hello.service...
Mar 12 03:08:31 ip-10-0-140-237 echo[1586]: hello
Mar 12 03:08:31 ip-10-0-140-237 systemd[1]: Finished hello.service.

core@ip-10-0-140-237:~$ ls -alh /etc/systemd/system/hello.service
-rw-r--r--. 1 root root 154 Mar 12 03:08 /etc/systemd/system/hello.service

The butane config file is:

$ cat hello.bu 
variant: fcos
version: 1.5.0
systemd:
  units:
    - name: hello.service
      enabled: true
      contents: |
        [Unit]
        Before=systemd-user-sessions.service
        [Service]
        Type=oneshot
        ExecStart=/usr/bin/echo hello
        RemainAfterExit=yes
        [Install]
        WantedBy=multi-user.target
passwd:
  users:
    - name: core
      ssh_authorized_keys:
        - ssh-rsa XXX

@travier
Copy link
Member

travier commented Mar 12, 2024

@HuijingHei You are not using dropins in your Butane config: https://coreos.github.io/butane/config-fcos-v1_5/

variant: fcos
version: 1.5.0
systemd:
  units:
    - name: hello.service
      enabled: true
      contents: |
        [Unit]
        Before=systemd-user-sessions.service
        [Service]
        Type=oneshot
        ExecStart=/usr/bin/echo hello
        RemainAfterExit=yes
        [Install]
        WantedBy=multi-user.target
      dropins:
         name: foo.conf
         contents: |
          [Unit]
          Description=Foo
passwd:
  users:
    - name: core
      ssh_authorized_keys:
        - ssh-rsa XXX

@HuijingHei
Copy link
Member

Thanks @travier , can not reproduce using above config.

[core@cosa-devsh ~]$ rpm -q ignition
ignition-2.17.0-1.fc39.x86_64
[core@cosa-devsh ~]$ ls -alh /etc/systemd/system/hello.service
-rw-r--r--. 1 root root 154 Mar 12 13:53 /etc/systemd/system/hello.service
[core@cosa-devsh ~]$ ls -alh /etc/systemd/system/hello.service.d/foo.conf 
-rw-r--r--. 1 root root 23 Mar 12 13:53 /etc/systemd/system/hello.service.d/foo.conf

@quentin9696
Copy link
Author

Hi Guys,

I finally try on my hand. The issue was on my butane code with some logic we added post-startup.

All is good. Sorry for that.

HuijingHei added a commit to HuijingHei/fedora-coreos-config that referenced this issue Mar 28, 2024
jbtrystram pushed a commit to coreos/fedora-coreos-config that referenced this issue Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira for syncing to jira
Projects
None yet
Development

No branches or pull requests

4 participants