Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: systemd/systemctl dual sendmail service start

  1. #1

    Default systemd/systemctl dual sendmail service start

    I want to migrate to opensuse 13.1 and I just can't find out how to configure the systemd scripts to start a dual sendmail daemon. Everything gets sent to systemctl and I'm just not familiar with it...

    I need sendmail to start twice: one daemon listening on port 25 and one on port 10025. I use amavis in between listening on port 10024. So: the first sendmail (port 25) receives the mail -from fetchmail-, delivers it to amavis (port 10024) which delivers it to the second sendmail (port 10025), which sends the mails to the mailbox.

    I need to start two sendmail daemons, as simple as that...

    Thank you all in advance,
    Luca

  2. #2
    Join Date
    Sep 2012
    Posts
    7,096

    Default Re: systemd/systemctl dual sendmail service start

    Quote Originally Posted by lpacor View Post
    I need to start two sendmail daemons, as simple as that...
    You will need to either create to different units with different name or create template unit that can be used to start different services from the same definition (like "systemctl start sendmail@25.service" and "systemctl start sendmail@10025.service"). See "man systemd.unit" for description of templates and there is plenty of examples in distributed units.

  3. #3
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    15,671
    Blog Entries
    3

    Default Re: systemd/systemctl dual sendmail service start

    Quote Originally Posted by lpacor View Post
    I need sendmail to start twice: one daemon listening on port 25 and one on port 10025.
    It's not hard to configure sendmail to listen on both ports. I have it listening on ports 25, 465 (with crypto), 587.

    If you need separate daemons, then you'll need to do something similar to what arvidjaar has suggested.
    openSUSE Leap 15.3; KDE Plasma 5.18.6;

  4. #4

    Default Re: systemd/systemctl dual sendmail service start

    Quote Originally Posted by arvidjaar View Post
    You will need to either create to different units with different name or create template unit that can be used to start different services from the same definition (like "systemctl start sendmail@25.service" and "systemctl start sendmail@10025.service"). See "man systemd.unit" for description of templates and there is plenty of examples in distributed units.
    ... and that is my problem... maybe I am too stupid but, as I said, I am not familiar at all with systemd/systemctl, so it's not easy for me to get it right...
    I would be really thankful if someone could post some examples that I could -so to say- copy and paste. One daemon is running as a standard so I guess I should only add one instance, but how?

    Cheers,
    Luca

  5. #5

    Default Re: systemd/systemctl dual sendmail service start

    Quote Originally Posted by nrickert View Post
    It's not hard to configure sendmail to listen on both ports. I have it listening on ports 25, 465 (with crypto), 587.

    If you need separate daemons, then you'll need to do something similar to what arvidjaar has suggested.
    I am not sure whether I do need two daemons... I actually did it that way because the first one (port 25) doesn't do delivery, it just receives the mails and gives them to amavis (spam and virus checker), which gives them to the second daemon which then does the delivery...
    Is this something you are doing as well?

    Thanks
    Luca

  6. #6
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    15,671
    Blog Entries
    3

    Default Re: systemd/systemctl dual sendmail service start

    Quote Originally Posted by lpacor View Post
    Is this something you are doing as well?
    No.

    I'll admit that if you are doing as you describe, then separate daemons with different configuration is easier to maintain.
    openSUSE Leap 15.3; KDE Plasma 5.18.6;

  7. #7

    Default Re: systemd/systemctl dual sendmail service start

    Quote Originally Posted by nrickert View Post
    No.

    I'll admit that if you are doing as you describe, then separate daemons with different configuration is easier to maintain.
    so would you (or someone else) be able and willing to guide me through?

    Thanks,
    Luca

  8. #8
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    15,671
    Blog Entries
    3

    Default Re: systemd/systemctl dual sendmail service start

    Quote Originally Posted by lpacor View Post
    so would you (or someone else) be able and willing to guide me through?

    Thanks,
    Luca
    I have not done that with systemd. I'd start by reading the man page recommended above by arvidjaar. If you need further help, hopefully someone with experience creating service definitions will be able to assist.
    openSUSE Leap 15.3; KDE Plasma 5.18.6;

  9. #9
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    13,295
    Blog Entries
    2

    Default Re: systemd/systemctl dual sendmail service start

    opensuse forums
    systemd/systemctl dual sendmail
    Although I haven't done what you describe, in theory it's pretty simple to do what you require.
    1. Install sendmail (or postfix which is actually the default SMTP server in openSUSE). It'll install everything necessary to run in a default state.
    2. run something like the following
    Code:
    systemctl status sendmail.service
    In the text you'll find the path to the Unit file which in systemd is the master config file(likely at /usr/lib/systemd/system/). In some ways it's similar to an init.d script except for a number of improvements... First invocation creates a CGROUP so all other instances like you're trying to do will be managed together.and usually share resources instead of creating a whole new process. Also, a Unit file is almost always a "master config" file so it points to other config files (often standard files found in init.d systems).

    Although it might be possible to add a new instance configuration to the existing Sendmail service, I suspect it might be easier to keep the new instance configuration completely separate.
    3. When you find the original created Unit file, copy it to
    Code:
    /etc/systemd/system/system/
    Now, if you wanted to modify the <existing installed> systemd function, you should just modify the file in the new location, it would over-ride the original installed file.

    But,
    Although it might be possible to add a new instance configuration to the existing Sendmail service, I suspect it might be easier to keep the new instance configuration completely separate.

    To keep your copy's configuration from completely over-writing the original default configuration, giving it a new name so it shouldn't over-write the original Unit settings and create something new.
    You may have to play around with the modifications in the Unit file(careful not to modify original configs which are still used by the original Unit file). Note though by working with a copy of the original you're in no danger of damaging the original install... just delete the copy you're working on.

    HTH,
    TSU

  10. #10

    Default Re: systemd/systemctl dual sendmail service start

    thank you everybody, I seem to have managed to make it work!
    I created the two service files (ports 25 and 10025) with the proper variables, renamed the original one, and voila, it works...

    thanks again to you all for your support,
    Luca

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •