Systemd - using the “+” prefix with ExecStartPre












3















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.










share|improve this question





























    3















    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.










    share|improve this question



























      3












      3








      3


      1






      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.










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 18 '17 at 20:37







      Brozovelt

















      asked Dec 18 '17 at 19:34









      BrozoveltBrozovelt

      285




      285






















          2 Answers
          2






          active

          oldest

          votes


















          3














          The documentation that you are using does not match the version of systemd that you are using. The "+" modifier was introduced in version 231.






          share|improve this answer



















          • 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














          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.






          share|improve this answer


























          • 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











          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
          });


          }
          });














          draft saved

          draft discarded


















          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









          3














          The documentation that you are using does not match the version of systemd that you are using. The "+" modifier was introduced in version 231.






          share|improve this answer



















          • 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
















          3














          The documentation that you are using does not match the version of systemd that you are using. The "+" modifier was introduced in version 231.






          share|improve this answer



















          • 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














          3












          3








          3







          The documentation that you are using does not match the version of systemd that you are using. The "+" modifier was introduced in version 231.






          share|improve this answer













          The documentation that you are using does not match the version of systemd that you are using. The "+" modifier was introduced in version 231.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          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














          • 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













          1














          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.






          share|improve this answer


























          • 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
















          1














          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.






          share|improve this answer


























          • 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














          1












          1








          1







          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.






          share|improve this answer















          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.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 1 min ago









          Mark Lakata

          3851517




          3851517










          answered Dec 18 '17 at 20:32









          BrozoveltBrozovelt

          285




          285













          • 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 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 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


















          draft saved

          draft discarded




















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Loup dans la culture

          How to solve the problem of ntp “Unable to contact time server” from KDE?

          ASUS Zenbook UX433/UX333 — Configure Touchpad-embedded numpad on Linux