Sample Header Ad - 728x90

systemctl authenticating as other user

1 vote
1 answer
3777 views
I have made this script that allows non-root access for a directory so a program can make changes to files in said directories. This .service has worked on a few machines and even on the same machine in the past however after a fresh reinstall of arch linux systemd/systemctl is "Authenticating as: mpd". The weird thing is when i use sudo to start it. It will work but using enable doesn't persist on reboot. I'm don't really know what I'm doing so i apologize I'm gonna read up on systemd after the semester.
[oddstap@Arch2019 ~]$ systemctl enable brightlight.service
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-unit-files ====
Authentication is required to manage system service or unit files.
Authenticating as: mpd
Password:
polkit-agent-helper-1: pam_authenticate failed: Authentication failure
==== AUTHENTICATION FAILED ====
Failed to enable unit: Access denied
[oddstap@Arch2019 ~]$
I'm not really sure why this is I've tried a few things like using the --user flag and then giving the exact directory. It has mixed results/ Ive also tried putting the service file in /etc/systemd/system that just does the same thing.
[oddstap@Arch2019 /usr/lib/systemd/system]$ systemctl --user enable /usr/lib/systemd/system/brightlight.service
Removed /home/oddstap/.config/systemd/user/multi-user.target.wants/brightlight.service.
Created symlink /home/oddstap/.config/systemd/user/multi-user.target.wants/brightlight.service → /usr/lib/systemd/system/brightlight.service.
[oddstap@Arch2019 /usr/lib/systemd/system]$
I've seen a similar issue I think [on Server Fault](https://serverfault.com/questions/841306/authentication-is-required-to-manage-system-services-or-units) . Here is the .service file I posted it here I'm pretty sure this is not the cause but I could be wrong. I'm gonna try to fix this but if anyone got any ideas let me know. Not having systemd enabling scripts is making my life hard.
[Unit]
Description Hopefully will be a solution for you reading.
Before nodered.service

[Service]
Type oneshot
User root
ExecStart=/bin/bash -c "/bin/chmod a+w /sys/class/backlight/intel_backlight/*"

[Install]
WantedBy=multi-user.target
Asked by mr Stap (61 rep)
Dec 2, 2019, 06:34 AM
Last activity: Jun 15, 2025, 07:06 PM