Systemd - using the “+” prefix with ExecStartPre
According to documentation, a +
may be used as a prefix in systemd
service configurations.
I am trying to use it like this:
[Service]
ExecStartPre=+/usr/bin/tomcat1
Type=simple
Environment="NAME=tomcat1"
EnvironmentFile=/etc/sysconfig/tomcat1
ExecStart=/usr/libexec/tomcat/server start
SuccessExitStatus=143
User=tomcat
Group=tomcat
I want to run /usr/bin/tomcat1
with elevated privileges, but doing so with the "+" sign gives the following error (note, "-" does not give an error).
"systemd1: [/usr/lib/systemd/system/tomcat1.service:10] Executable path is not absolute, ignoring: +/usr/bin/tomcat1"
Ive also tried ExecStartPre="+/usr/bin/tomcat1
, ExecStartPre="+"/usr/bin/tomcat1
, etc.
I know I can use PermissionsStartOnly=true as an alternative, which should work, but that seemed less than idea.
centos rhel systemd
add a comment |
According to documentation, a +
may be used as a prefix in systemd
service configurations.
I am trying to use it like this:
[Service]
ExecStartPre=+/usr/bin/tomcat1
Type=simple
Environment="NAME=tomcat1"
EnvironmentFile=/etc/sysconfig/tomcat1
ExecStart=/usr/libexec/tomcat/server start
SuccessExitStatus=143
User=tomcat
Group=tomcat
I want to run /usr/bin/tomcat1
with elevated privileges, but doing so with the "+" sign gives the following error (note, "-" does not give an error).
"systemd1: [/usr/lib/systemd/system/tomcat1.service:10] Executable path is not absolute, ignoring: +/usr/bin/tomcat1"
Ive also tried ExecStartPre="+/usr/bin/tomcat1
, ExecStartPre="+"/usr/bin/tomcat1
, etc.
I know I can use PermissionsStartOnly=true as an alternative, which should work, but that seemed less than idea.
centos rhel systemd
add a comment |
According to documentation, a +
may be used as a prefix in systemd
service configurations.
I am trying to use it like this:
[Service]
ExecStartPre=+/usr/bin/tomcat1
Type=simple
Environment="NAME=tomcat1"
EnvironmentFile=/etc/sysconfig/tomcat1
ExecStart=/usr/libexec/tomcat/server start
SuccessExitStatus=143
User=tomcat
Group=tomcat
I want to run /usr/bin/tomcat1
with elevated privileges, but doing so with the "+" sign gives the following error (note, "-" does not give an error).
"systemd1: [/usr/lib/systemd/system/tomcat1.service:10] Executable path is not absolute, ignoring: +/usr/bin/tomcat1"
Ive also tried ExecStartPre="+/usr/bin/tomcat1
, ExecStartPre="+"/usr/bin/tomcat1
, etc.
I know I can use PermissionsStartOnly=true as an alternative, which should work, but that seemed less than idea.
centos rhel systemd
According to documentation, a +
may be used as a prefix in systemd
service configurations.
I am trying to use it like this:
[Service]
ExecStartPre=+/usr/bin/tomcat1
Type=simple
Environment="NAME=tomcat1"
EnvironmentFile=/etc/sysconfig/tomcat1
ExecStart=/usr/libexec/tomcat/server start
SuccessExitStatus=143
User=tomcat
Group=tomcat
I want to run /usr/bin/tomcat1
with elevated privileges, but doing so with the "+" sign gives the following error (note, "-" does not give an error).
"systemd1: [/usr/lib/systemd/system/tomcat1.service:10] Executable path is not absolute, ignoring: +/usr/bin/tomcat1"
Ive also tried ExecStartPre="+/usr/bin/tomcat1
, ExecStartPre="+"/usr/bin/tomcat1
, etc.
I know I can use PermissionsStartOnly=true as an alternative, which should work, but that seemed less than idea.
centos rhel systemd
centos rhel systemd
edited Dec 18 '17 at 20:37
Brozovelt
asked Dec 18 '17 at 19:34
BrozoveltBrozovelt
285
285
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
The documentation that you are using does not match the version of systemd that you are using. The "+" modifier was introduced in version 231.
1
Yea this seems to be the case, the installed version is 219. Thanks for confirmation with the version #.
– Brozovelt
Dec 19 '17 at 15:45
add a comment |
It seems like the documentation I was using as reference may be inaccurate or out of date (perhaps support for +, !, etc was removed). Running man systemd.service
server side seems to only mention "-". It would be great if anyone could confirm this, however.
I see it being used withExecStart
notExecStartPre
in that manual link
– George Udosen
Dec 18 '17 at 21:31
I thought that might be the case at first as well, however, right after the table it states "Note that these prefixes are also supported for the other command line settings, i.e. ExecStartPre=, ExecStartPost=, ExecReload, ExecStop= and ExecStopPost=."
– Brozovelt
Dec 18 '17 at 22:28
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2funix.stackexchange.com%2fquestions%2f411649%2fsystemd-using-the-prefix-with-execstartpre%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
The documentation that you are using does not match the version of systemd that you are using. The "+" modifier was introduced in version 231.
1
Yea this seems to be the case, the installed version is 219. Thanks for confirmation with the version #.
– Brozovelt
Dec 19 '17 at 15:45
add a comment |
The documentation that you are using does not match the version of systemd that you are using. The "+" modifier was introduced in version 231.
1
Yea this seems to be the case, the installed version is 219. Thanks for confirmation with the version #.
– Brozovelt
Dec 19 '17 at 15:45
add a comment |
The documentation that you are using does not match the version of systemd that you are using. The "+" modifier was introduced in version 231.
The documentation that you are using does not match the version of systemd that you are using. The "+" modifier was introduced in version 231.
answered Dec 18 '17 at 23:51
JdeBPJdeBP
35.9k473171
35.9k473171
1
Yea this seems to be the case, the installed version is 219. Thanks for confirmation with the version #.
– Brozovelt
Dec 19 '17 at 15:45
add a comment |
1
Yea this seems to be the case, the installed version is 219. Thanks for confirmation with the version #.
– Brozovelt
Dec 19 '17 at 15:45
1
1
Yea this seems to be the case, the installed version is 219. Thanks for confirmation with the version #.
– Brozovelt
Dec 19 '17 at 15:45
Yea this seems to be the case, the installed version is 219. Thanks for confirmation with the version #.
– Brozovelt
Dec 19 '17 at 15:45
add a comment |
It seems like the documentation I was using as reference may be inaccurate or out of date (perhaps support for +, !, etc was removed). Running man systemd.service
server side seems to only mention "-". It would be great if anyone could confirm this, however.
I see it being used withExecStart
notExecStartPre
in that manual link
– George Udosen
Dec 18 '17 at 21:31
I thought that might be the case at first as well, however, right after the table it states "Note that these prefixes are also supported for the other command line settings, i.e. ExecStartPre=, ExecStartPost=, ExecReload, ExecStop= and ExecStopPost=."
– Brozovelt
Dec 18 '17 at 22:28
add a comment |
It seems like the documentation I was using as reference may be inaccurate or out of date (perhaps support for +, !, etc was removed). Running man systemd.service
server side seems to only mention "-". It would be great if anyone could confirm this, however.
I see it being used withExecStart
notExecStartPre
in that manual link
– George Udosen
Dec 18 '17 at 21:31
I thought that might be the case at first as well, however, right after the table it states "Note that these prefixes are also supported for the other command line settings, i.e. ExecStartPre=, ExecStartPost=, ExecReload, ExecStop= and ExecStopPost=."
– Brozovelt
Dec 18 '17 at 22:28
add a comment |
It seems like the documentation I was using as reference may be inaccurate or out of date (perhaps support for +, !, etc was removed). Running man systemd.service
server side seems to only mention "-". It would be great if anyone could confirm this, however.
It seems like the documentation I was using as reference may be inaccurate or out of date (perhaps support for +, !, etc was removed). Running man systemd.service
server side seems to only mention "-". It would be great if anyone could confirm this, however.
edited 1 min ago
Mark Lakata
3851517
3851517
answered Dec 18 '17 at 20:32
BrozoveltBrozovelt
285
285
I see it being used withExecStart
notExecStartPre
in that manual link
– George Udosen
Dec 18 '17 at 21:31
I thought that might be the case at first as well, however, right after the table it states "Note that these prefixes are also supported for the other command line settings, i.e. ExecStartPre=, ExecStartPost=, ExecReload, ExecStop= and ExecStopPost=."
– Brozovelt
Dec 18 '17 at 22:28
add a comment |
I see it being used withExecStart
notExecStartPre
in that manual link
– George Udosen
Dec 18 '17 at 21:31
I thought that might be the case at first as well, however, right after the table it states "Note that these prefixes are also supported for the other command line settings, i.e. ExecStartPre=, ExecStartPost=, ExecReload, ExecStop= and ExecStopPost=."
– Brozovelt
Dec 18 '17 at 22:28
I see it being used with
ExecStart
not ExecStartPre
in that manual link– George Udosen
Dec 18 '17 at 21:31
I see it being used with
ExecStart
not ExecStartPre
in that manual link– George Udosen
Dec 18 '17 at 21:31
I thought that might be the case at first as well, however, right after the table it states "Note that these prefixes are also supported for the other command line settings, i.e. ExecStartPre=, ExecStartPost=, ExecReload, ExecStop= and ExecStopPost=."
– Brozovelt
Dec 18 '17 at 22:28
I thought that might be the case at first as well, however, right after the table it states "Note that these prefixes are also supported for the other command line settings, i.e. ExecStartPre=, ExecStartPost=, ExecReload, ExecStop= and ExecStopPost=."
– Brozovelt
Dec 18 '17 at 22:28
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- 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%2funix.stackexchange.com%2fquestions%2f411649%2fsystemd-using-the-prefix-with-execstartpre%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