Systemd service starts with enable/start command but does nothing on startup
I have a simple script which set keyboard back-light to 0 on startup. It work if invoked manually.
And I have service which should invoke it on startup.
[Unit]
Description=Power_off keyboard backlight on startup
[Service]
Type=oneshot
ExecStart=/etc/kbd_to_zero
RemainAfterExit=yes
[Install]
WantedBy=default.target
And this service works fine when running command systemctl enable now or start.
But it does nothing on startup.
journalctl says that
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA systemd[1]: Starting Power_off keyboard backlight on startup...
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA sudo[3370]: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/tee /sys/class/leds/asus::kbd_backlight/brightness
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA sudo[3370]: pam_unix(sudo:session): session opened for user root by (uid=0)
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA kbd_to_zero[3364]: 0
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA sudo[3370]: pam_unix(sudo:session): session closed for user root
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA systemd[1]: Started Power_off keyboard backlight on startup.
What I'm doing wrong.
Thanks
systemd
add a comment |
I have a simple script which set keyboard back-light to 0 on startup. It work if invoked manually.
And I have service which should invoke it on startup.
[Unit]
Description=Power_off keyboard backlight on startup
[Service]
Type=oneshot
ExecStart=/etc/kbd_to_zero
RemainAfterExit=yes
[Install]
WantedBy=default.target
And this service works fine when running command systemctl enable now or start.
But it does nothing on startup.
journalctl says that
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA systemd[1]: Starting Power_off keyboard backlight on startup...
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA sudo[3370]: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/tee /sys/class/leds/asus::kbd_backlight/brightness
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA sudo[3370]: pam_unix(sudo:session): session opened for user root by (uid=0)
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA kbd_to_zero[3364]: 0
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA sudo[3370]: pam_unix(sudo:session): session closed for user root
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA systemd[1]: Started Power_off keyboard backlight on startup.
What I'm doing wrong.
Thanks
systemd
add a comment |
I have a simple script which set keyboard back-light to 0 on startup. It work if invoked manually.
And I have service which should invoke it on startup.
[Unit]
Description=Power_off keyboard backlight on startup
[Service]
Type=oneshot
ExecStart=/etc/kbd_to_zero
RemainAfterExit=yes
[Install]
WantedBy=default.target
And this service works fine when running command systemctl enable now or start.
But it does nothing on startup.
journalctl says that
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA systemd[1]: Starting Power_off keyboard backlight on startup...
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA sudo[3370]: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/tee /sys/class/leds/asus::kbd_backlight/brightness
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA sudo[3370]: pam_unix(sudo:session): session opened for user root by (uid=0)
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA kbd_to_zero[3364]: 0
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA sudo[3370]: pam_unix(sudo:session): session closed for user root
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA systemd[1]: Started Power_off keyboard backlight on startup.
What I'm doing wrong.
Thanks
systemd
I have a simple script which set keyboard back-light to 0 on startup. It work if invoked manually.
And I have service which should invoke it on startup.
[Unit]
Description=Power_off keyboard backlight on startup
[Service]
Type=oneshot
ExecStart=/etc/kbd_to_zero
RemainAfterExit=yes
[Install]
WantedBy=default.target
And this service works fine when running command systemctl enable now or start.
But it does nothing on startup.
journalctl says that
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA systemd[1]: Starting Power_off keyboard backlight on startup...
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA sudo[3370]: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/tee /sys/class/leds/asus::kbd_backlight/brightness
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA sudo[3370]: pam_unix(sudo:session): session opened for user root by (uid=0)
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA kbd_to_zero[3364]: 0
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA sudo[3370]: pam_unix(sudo:session): session closed for user root
січ 24 02:05:35 dmytro-VivoBook-S15-X530UA systemd[1]: Started Power_off keyboard backlight on startup.
What I'm doing wrong.
Thanks
systemd
systemd
edited Jan 24 at 0:41
Doug Smythies
7,28131530
7,28131530
asked Jan 24 at 0:23
MityaMitya
33
33
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Did you try running the enable command? Assuming your service is called keyboard-backlight.service, try running the following: systemctl enable keyboard-backlight.service
.
Yes. It instantly set back-light to zero. Then I set it back and rebooted and nothing happens.
– Mitya
Jan 24 at 10:18
Sorry for my previous comment. That was the solution. I was sure that I had tried enable without now. Now everything works.
– Mitya
Jan 24 at 10:41
I'm not sure what you meant by "tried enable without now", but I'm glad to hear everything's working for you. :-)
– TSJNachos117
Jan 27 at 0:28
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1112364%2fsystemd-service-starts-with-enable-start-command-but-does-nothing-on-startup%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Did you try running the enable command? Assuming your service is called keyboard-backlight.service, try running the following: systemctl enable keyboard-backlight.service
.
Yes. It instantly set back-light to zero. Then I set it back and rebooted and nothing happens.
– Mitya
Jan 24 at 10:18
Sorry for my previous comment. That was the solution. I was sure that I had tried enable without now. Now everything works.
– Mitya
Jan 24 at 10:41
I'm not sure what you meant by "tried enable without now", but I'm glad to hear everything's working for you. :-)
– TSJNachos117
Jan 27 at 0:28
add a comment |
Did you try running the enable command? Assuming your service is called keyboard-backlight.service, try running the following: systemctl enable keyboard-backlight.service
.
Yes. It instantly set back-light to zero. Then I set it back and rebooted and nothing happens.
– Mitya
Jan 24 at 10:18
Sorry for my previous comment. That was the solution. I was sure that I had tried enable without now. Now everything works.
– Mitya
Jan 24 at 10:41
I'm not sure what you meant by "tried enable without now", but I'm glad to hear everything's working for you. :-)
– TSJNachos117
Jan 27 at 0:28
add a comment |
Did you try running the enable command? Assuming your service is called keyboard-backlight.service, try running the following: systemctl enable keyboard-backlight.service
.
Did you try running the enable command? Assuming your service is called keyboard-backlight.service, try running the following: systemctl enable keyboard-backlight.service
.
answered Jan 24 at 0:47
TSJNachos117TSJNachos117
8822915
8822915
Yes. It instantly set back-light to zero. Then I set it back and rebooted and nothing happens.
– Mitya
Jan 24 at 10:18
Sorry for my previous comment. That was the solution. I was sure that I had tried enable without now. Now everything works.
– Mitya
Jan 24 at 10:41
I'm not sure what you meant by "tried enable without now", but I'm glad to hear everything's working for you. :-)
– TSJNachos117
Jan 27 at 0:28
add a comment |
Yes. It instantly set back-light to zero. Then I set it back and rebooted and nothing happens.
– Mitya
Jan 24 at 10:18
Sorry for my previous comment. That was the solution. I was sure that I had tried enable without now. Now everything works.
– Mitya
Jan 24 at 10:41
I'm not sure what you meant by "tried enable without now", but I'm glad to hear everything's working for you. :-)
– TSJNachos117
Jan 27 at 0:28
Yes. It instantly set back-light to zero. Then I set it back and rebooted and nothing happens.
– Mitya
Jan 24 at 10:18
Yes. It instantly set back-light to zero. Then I set it back and rebooted and nothing happens.
– Mitya
Jan 24 at 10:18
Sorry for my previous comment. That was the solution. I was sure that I had tried enable without now. Now everything works.
– Mitya
Jan 24 at 10:41
Sorry for my previous comment. That was the solution. I was sure that I had tried enable without now. Now everything works.
– Mitya
Jan 24 at 10:41
I'm not sure what you meant by "tried enable without now", but I'm glad to hear everything's working for you. :-)
– TSJNachos117
Jan 27 at 0:28
I'm not sure what you meant by "tried enable without now", but I'm glad to hear everything's working for you. :-)
– TSJNachos117
Jan 27 at 0:28
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1112364%2fsystemd-service-starts-with-enable-start-command-but-does-nothing-on-startup%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown