Opendkim won't start: can't open PID file?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







1















This is the complaint I get from systemd:



"opendkim.service: Can't open PID file /var/run/opendkim/opendkim.pid"


As seen here:



systemctl status opendkim.service


puts out this:



● opendkim.service - OpenDKIM DomainKeys Identified Mail (DKIM) Milter
Loaded: loaded (/lib/systemd/system/opendkim.service; enabled; vendor preset: enabled)
Active: deactivating (stop-sigterm) (Result: timeout)
Docs: man:opendkim(8)
man:opendkim.conf(5)
man:opendkim-genkey(8)
man:opendkim-genzone(8)
man:opendkim-testadsp(8)
man:opendkim-testkey
http://www.opendkim.org/docs.html
Process: 8217 ExecStart=/usr/sbin/opendkim -x /etc/opendkim.conf (code=exited, status=0/SUCCESS)
Tasks: 6 (limit: 2361)
CGroup: /system.slice/opendkim.service
└─8226 /usr/sbin/opendkim -x /etc/opendkim.conf

Feb 11 04:56:48 hacksaw.org systemd[1]: Starting OpenDKIM DomainKeys Identified Mail (DKIM) Milter...
Feb 11 04:56:48 hacksaw.org systemd[1]: opendkim.service: Can't open PID file /var/run/opendkim/opendkim.pid (yet?) after start: No such file or directory
Feb 11 04:56:48 hacksaw.org opendkim[8226]: OpenDKIM Filter v2.11.0 starting (args: -x /etc/opendkim.conf)
Feb 11 04:58:18 hacksaw.org systemd[1]: opendkim.service: Start operation timed out. Terminating.


If I start the daemon by hand, it goes. This seems to be about systemd.



Other data:



#ls -ld /var/run/opendkim/
drwxr-xr-x 2 opendkim opendkim 40 Feb 11 04:25 /var/run/opendkim/


The only line on the opendkim.conf:



UserID      opendkim:opendkim


The default opendkim service file, from /lib/systemd/service:



[Unit]
Description=OpenDKIM DomainKeys Identified Mail (DKIM) Milter
Documentation=man:opendkim(8) man:opendkim.conf(5) man:opendkim-genkey(8) man:opendkim-genzone(8) man:opendkim-testadsp(8) man:opendkim-testkey http://www.opendkim.org/docs.html
After=network.target nss-lookup.target

[Service]
Type=forking
PIDFile=/var/run/opendkim/opendkim.pid
UMask=0007
ExecStart=/usr/sbin/opendkim -x /etc/opendkim.conf
Restart=on-failure
ExecReload=/bin/kill -USR1 $MAINPID

[Install]
WantedBy=multi-user.target









share|improve this question




















  • 1





    Does this answer your question?

    – Jos
    Feb 11 at 10:28











  • No, but it did shorten my path to an answer.

    – Hack Saw
    Feb 11 at 21:38


















1















This is the complaint I get from systemd:



"opendkim.service: Can't open PID file /var/run/opendkim/opendkim.pid"


As seen here:



systemctl status opendkim.service


puts out this:



● opendkim.service - OpenDKIM DomainKeys Identified Mail (DKIM) Milter
Loaded: loaded (/lib/systemd/system/opendkim.service; enabled; vendor preset: enabled)
Active: deactivating (stop-sigterm) (Result: timeout)
Docs: man:opendkim(8)
man:opendkim.conf(5)
man:opendkim-genkey(8)
man:opendkim-genzone(8)
man:opendkim-testadsp(8)
man:opendkim-testkey
http://www.opendkim.org/docs.html
Process: 8217 ExecStart=/usr/sbin/opendkim -x /etc/opendkim.conf (code=exited, status=0/SUCCESS)
Tasks: 6 (limit: 2361)
CGroup: /system.slice/opendkim.service
└─8226 /usr/sbin/opendkim -x /etc/opendkim.conf

Feb 11 04:56:48 hacksaw.org systemd[1]: Starting OpenDKIM DomainKeys Identified Mail (DKIM) Milter...
Feb 11 04:56:48 hacksaw.org systemd[1]: opendkim.service: Can't open PID file /var/run/opendkim/opendkim.pid (yet?) after start: No such file or directory
Feb 11 04:56:48 hacksaw.org opendkim[8226]: OpenDKIM Filter v2.11.0 starting (args: -x /etc/opendkim.conf)
Feb 11 04:58:18 hacksaw.org systemd[1]: opendkim.service: Start operation timed out. Terminating.


If I start the daemon by hand, it goes. This seems to be about systemd.



Other data:



#ls -ld /var/run/opendkim/
drwxr-xr-x 2 opendkim opendkim 40 Feb 11 04:25 /var/run/opendkim/


The only line on the opendkim.conf:



UserID      opendkim:opendkim


The default opendkim service file, from /lib/systemd/service:



[Unit]
Description=OpenDKIM DomainKeys Identified Mail (DKIM) Milter
Documentation=man:opendkim(8) man:opendkim.conf(5) man:opendkim-genkey(8) man:opendkim-genzone(8) man:opendkim-testadsp(8) man:opendkim-testkey http://www.opendkim.org/docs.html
After=network.target nss-lookup.target

[Service]
Type=forking
PIDFile=/var/run/opendkim/opendkim.pid
UMask=0007
ExecStart=/usr/sbin/opendkim -x /etc/opendkim.conf
Restart=on-failure
ExecReload=/bin/kill -USR1 $MAINPID

[Install]
WantedBy=multi-user.target









share|improve this question




















  • 1





    Does this answer your question?

    – Jos
    Feb 11 at 10:28











  • No, but it did shorten my path to an answer.

    – Hack Saw
    Feb 11 at 21:38














1












1








1








This is the complaint I get from systemd:



"opendkim.service: Can't open PID file /var/run/opendkim/opendkim.pid"


As seen here:



systemctl status opendkim.service


puts out this:



● opendkim.service - OpenDKIM DomainKeys Identified Mail (DKIM) Milter
Loaded: loaded (/lib/systemd/system/opendkim.service; enabled; vendor preset: enabled)
Active: deactivating (stop-sigterm) (Result: timeout)
Docs: man:opendkim(8)
man:opendkim.conf(5)
man:opendkim-genkey(8)
man:opendkim-genzone(8)
man:opendkim-testadsp(8)
man:opendkim-testkey
http://www.opendkim.org/docs.html
Process: 8217 ExecStart=/usr/sbin/opendkim -x /etc/opendkim.conf (code=exited, status=0/SUCCESS)
Tasks: 6 (limit: 2361)
CGroup: /system.slice/opendkim.service
└─8226 /usr/sbin/opendkim -x /etc/opendkim.conf

Feb 11 04:56:48 hacksaw.org systemd[1]: Starting OpenDKIM DomainKeys Identified Mail (DKIM) Milter...
Feb 11 04:56:48 hacksaw.org systemd[1]: opendkim.service: Can't open PID file /var/run/opendkim/opendkim.pid (yet?) after start: No such file or directory
Feb 11 04:56:48 hacksaw.org opendkim[8226]: OpenDKIM Filter v2.11.0 starting (args: -x /etc/opendkim.conf)
Feb 11 04:58:18 hacksaw.org systemd[1]: opendkim.service: Start operation timed out. Terminating.


If I start the daemon by hand, it goes. This seems to be about systemd.



Other data:



#ls -ld /var/run/opendkim/
drwxr-xr-x 2 opendkim opendkim 40 Feb 11 04:25 /var/run/opendkim/


The only line on the opendkim.conf:



UserID      opendkim:opendkim


The default opendkim service file, from /lib/systemd/service:



[Unit]
Description=OpenDKIM DomainKeys Identified Mail (DKIM) Milter
Documentation=man:opendkim(8) man:opendkim.conf(5) man:opendkim-genkey(8) man:opendkim-genzone(8) man:opendkim-testadsp(8) man:opendkim-testkey http://www.opendkim.org/docs.html
After=network.target nss-lookup.target

[Service]
Type=forking
PIDFile=/var/run/opendkim/opendkim.pid
UMask=0007
ExecStart=/usr/sbin/opendkim -x /etc/opendkim.conf
Restart=on-failure
ExecReload=/bin/kill -USR1 $MAINPID

[Install]
WantedBy=multi-user.target









share|improve this question
















This is the complaint I get from systemd:



"opendkim.service: Can't open PID file /var/run/opendkim/opendkim.pid"


As seen here:



systemctl status opendkim.service


puts out this:



● opendkim.service - OpenDKIM DomainKeys Identified Mail (DKIM) Milter
Loaded: loaded (/lib/systemd/system/opendkim.service; enabled; vendor preset: enabled)
Active: deactivating (stop-sigterm) (Result: timeout)
Docs: man:opendkim(8)
man:opendkim.conf(5)
man:opendkim-genkey(8)
man:opendkim-genzone(8)
man:opendkim-testadsp(8)
man:opendkim-testkey
http://www.opendkim.org/docs.html
Process: 8217 ExecStart=/usr/sbin/opendkim -x /etc/opendkim.conf (code=exited, status=0/SUCCESS)
Tasks: 6 (limit: 2361)
CGroup: /system.slice/opendkim.service
└─8226 /usr/sbin/opendkim -x /etc/opendkim.conf

Feb 11 04:56:48 hacksaw.org systemd[1]: Starting OpenDKIM DomainKeys Identified Mail (DKIM) Milter...
Feb 11 04:56:48 hacksaw.org systemd[1]: opendkim.service: Can't open PID file /var/run/opendkim/opendkim.pid (yet?) after start: No such file or directory
Feb 11 04:56:48 hacksaw.org opendkim[8226]: OpenDKIM Filter v2.11.0 starting (args: -x /etc/opendkim.conf)
Feb 11 04:58:18 hacksaw.org systemd[1]: opendkim.service: Start operation timed out. Terminating.


If I start the daemon by hand, it goes. This seems to be about systemd.



Other data:



#ls -ld /var/run/opendkim/
drwxr-xr-x 2 opendkim opendkim 40 Feb 11 04:25 /var/run/opendkim/


The only line on the opendkim.conf:



UserID      opendkim:opendkim


The default opendkim service file, from /lib/systemd/service:



[Unit]
Description=OpenDKIM DomainKeys Identified Mail (DKIM) Milter
Documentation=man:opendkim(8) man:opendkim.conf(5) man:opendkim-genkey(8) man:opendkim-genzone(8) man:opendkim-testadsp(8) man:opendkim-testkey http://www.opendkim.org/docs.html
After=network.target nss-lookup.target

[Service]
Type=forking
PIDFile=/var/run/opendkim/opendkim.pid
UMask=0007
ExecStart=/usr/sbin/opendkim -x /etc/opendkim.conf
Restart=on-failure
ExecReload=/bin/kill -USR1 $MAINPID

[Install]
WantedBy=multi-user.target






18.04 systemd dkim






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 11 at 21:44







Hack Saw

















asked Feb 11 at 10:13









Hack SawHack Saw

1388




1388








  • 1





    Does this answer your question?

    – Jos
    Feb 11 at 10:28











  • No, but it did shorten my path to an answer.

    – Hack Saw
    Feb 11 at 21:38














  • 1





    Does this answer your question?

    – Jos
    Feb 11 at 10:28











  • No, but it did shorten my path to an answer.

    – Hack Saw
    Feb 11 at 21:38








1




1





Does this answer your question?

– Jos
Feb 11 at 10:28





Does this answer your question?

– Jos
Feb 11 at 10:28













No, but it did shorten my path to an answer.

– Hack Saw
Feb 11 at 21:38





No, but it did shorten my path to an answer.

– Hack Saw
Feb 11 at 21:38










2 Answers
2






active

oldest

votes


















0














Since this daemon runs alone, systemd doesn't need anything special to manage it. Importantly, having a "PIDFile" directive suggests that it's a more complicated service, and will put a PID into the PIDFile on it's own.



The solution is to remove the PIDFile line. Now systemd handles it just fine.






share|improve this answer































    0














    I fixed it by specifying the PidFile in the /etc/opendkim.conf file:



    PidFile                 /var/run/opendkim/opendkim.pid


    I think it's better to solve it here than modifying the systemd script. Also, systemd recommends the PIDFile option if the Type option is set to forking, which it seems to be in this service.



    This PidFile setting was present in the default /etc/opendkim.conf file. However, I replaced it while I was followed a tutorial for configuring OpenDKIM. So that is where it went wrong for me.






    share|improve this answer
























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


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1117330%2fopendkim-wont-start-cant-open-pid-file%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









      0














      Since this daemon runs alone, systemd doesn't need anything special to manage it. Importantly, having a "PIDFile" directive suggests that it's a more complicated service, and will put a PID into the PIDFile on it's own.



      The solution is to remove the PIDFile line. Now systemd handles it just fine.






      share|improve this answer




























        0














        Since this daemon runs alone, systemd doesn't need anything special to manage it. Importantly, having a "PIDFile" directive suggests that it's a more complicated service, and will put a PID into the PIDFile on it's own.



        The solution is to remove the PIDFile line. Now systemd handles it just fine.






        share|improve this answer


























          0












          0








          0







          Since this daemon runs alone, systemd doesn't need anything special to manage it. Importantly, having a "PIDFile" directive suggests that it's a more complicated service, and will put a PID into the PIDFile on it's own.



          The solution is to remove the PIDFile line. Now systemd handles it just fine.






          share|improve this answer













          Since this daemon runs alone, systemd doesn't need anything special to manage it. Importantly, having a "PIDFile" directive suggests that it's a more complicated service, and will put a PID into the PIDFile on it's own.



          The solution is to remove the PIDFile line. Now systemd handles it just fine.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 11 at 21:42









          Hack SawHack Saw

          1388




          1388

























              0














              I fixed it by specifying the PidFile in the /etc/opendkim.conf file:



              PidFile                 /var/run/opendkim/opendkim.pid


              I think it's better to solve it here than modifying the systemd script. Also, systemd recommends the PIDFile option if the Type option is set to forking, which it seems to be in this service.



              This PidFile setting was present in the default /etc/opendkim.conf file. However, I replaced it while I was followed a tutorial for configuring OpenDKIM. So that is where it went wrong for me.






              share|improve this answer




























                0














                I fixed it by specifying the PidFile in the /etc/opendkim.conf file:



                PidFile                 /var/run/opendkim/opendkim.pid


                I think it's better to solve it here than modifying the systemd script. Also, systemd recommends the PIDFile option if the Type option is set to forking, which it seems to be in this service.



                This PidFile setting was present in the default /etc/opendkim.conf file. However, I replaced it while I was followed a tutorial for configuring OpenDKIM. So that is where it went wrong for me.






                share|improve this answer


























                  0












                  0








                  0







                  I fixed it by specifying the PidFile in the /etc/opendkim.conf file:



                  PidFile                 /var/run/opendkim/opendkim.pid


                  I think it's better to solve it here than modifying the systemd script. Also, systemd recommends the PIDFile option if the Type option is set to forking, which it seems to be in this service.



                  This PidFile setting was present in the default /etc/opendkim.conf file. However, I replaced it while I was followed a tutorial for configuring OpenDKIM. So that is where it went wrong for me.






                  share|improve this answer













                  I fixed it by specifying the PidFile in the /etc/opendkim.conf file:



                  PidFile                 /var/run/opendkim/opendkim.pid


                  I think it's better to solve it here than modifying the systemd script. Also, systemd recommends the PIDFile option if the Type option is set to forking, which it seems to be in this service.



                  This PidFile setting was present in the default /etc/opendkim.conf file. However, I replaced it while I was followed a tutorial for configuring OpenDKIM. So that is where it went wrong for me.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Apr 9 at 10:10









                  gitaarikgitaarik

                  1014




                  1014






























                      draft saved

                      draft discarded




















































                      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.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1117330%2fopendkim-wont-start-cant-open-pid-file%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

                      Human spaceflight

                      Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

                      張江高科駅