systemd âsocket activationâ vs xinetd
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I use xinetd
and it works for my purposes. However I recently discovered that systemd has something built in called "socket activation".
These two seem very similar, but systemd is "official" and seems like the better choice.
However before using it, are they really the same? Are there differences I should be aware of?
For example, I want to start some dockerised services only when they are first requested - my first thought would be to use xinetd. But is socket activation better / faster / stabler / whatever?
linux ubuntu systemd xinetd socket-activation
add a comment |Â
up vote
1
down vote
favorite
I use xinetd
and it works for my purposes. However I recently discovered that systemd has something built in called "socket activation".
These two seem very similar, but systemd is "official" and seems like the better choice.
However before using it, are they really the same? Are there differences I should be aware of?
For example, I want to start some dockerised services only when they are first requested - my first thought would be to use xinetd. But is socket activation better / faster / stabler / whatever?
linux ubuntu systemd xinetd socket-activation
If both work, use what you are comfortable with.
â RalfFriedl
1 hour ago
@RalfFriedl Good advice, but I'd rather use what is more official/standard - it seems to me that would be socket activation. However I can't find info anywhere stating whether they actually do the same thing, I don't want to run into any problems.
â lonix
1 hour ago
1
According to thesystemd
crowd,systemd
should be used for everything.xinetd
won't cause you any problems. Withsystemd
you have to write two files, a.service
file and a.socket
file. Both approaches will work.
â RalfFriedl
54 mins ago
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I use xinetd
and it works for my purposes. However I recently discovered that systemd has something built in called "socket activation".
These two seem very similar, but systemd is "official" and seems like the better choice.
However before using it, are they really the same? Are there differences I should be aware of?
For example, I want to start some dockerised services only when they are first requested - my first thought would be to use xinetd. But is socket activation better / faster / stabler / whatever?
linux ubuntu systemd xinetd socket-activation
I use xinetd
and it works for my purposes. However I recently discovered that systemd has something built in called "socket activation".
These two seem very similar, but systemd is "official" and seems like the better choice.
However before using it, are they really the same? Are there differences I should be aware of?
For example, I want to start some dockerised services only when they are first requested - my first thought would be to use xinetd. But is socket activation better / faster / stabler / whatever?
linux ubuntu systemd xinetd socket-activation
linux ubuntu systemd xinetd socket-activation
edited 58 mins ago
asked 1 hour ago
lonix
19719
19719
If both work, use what you are comfortable with.
â RalfFriedl
1 hour ago
@RalfFriedl Good advice, but I'd rather use what is more official/standard - it seems to me that would be socket activation. However I can't find info anywhere stating whether they actually do the same thing, I don't want to run into any problems.
â lonix
1 hour ago
1
According to thesystemd
crowd,systemd
should be used for everything.xinetd
won't cause you any problems. Withsystemd
you have to write two files, a.service
file and a.socket
file. Both approaches will work.
â RalfFriedl
54 mins ago
add a comment |Â
If both work, use what you are comfortable with.
â RalfFriedl
1 hour ago
@RalfFriedl Good advice, but I'd rather use what is more official/standard - it seems to me that would be socket activation. However I can't find info anywhere stating whether they actually do the same thing, I don't want to run into any problems.
â lonix
1 hour ago
1
According to thesystemd
crowd,systemd
should be used for everything.xinetd
won't cause you any problems. Withsystemd
you have to write two files, a.service
file and a.socket
file. Both approaches will work.
â RalfFriedl
54 mins ago
If both work, use what you are comfortable with.
â RalfFriedl
1 hour ago
If both work, use what you are comfortable with.
â RalfFriedl
1 hour ago
@RalfFriedl Good advice, but I'd rather use what is more official/standard - it seems to me that would be socket activation. However I can't find info anywhere stating whether they actually do the same thing, I don't want to run into any problems.
â lonix
1 hour ago
@RalfFriedl Good advice, but I'd rather use what is more official/standard - it seems to me that would be socket activation. However I can't find info anywhere stating whether they actually do the same thing, I don't want to run into any problems.
â lonix
1 hour ago
1
1
According to the
systemd
crowd, systemd
should be used for everything. xinetd
won't cause you any problems. With systemd
you have to write two files, a .service
file and a .socket
file. Both approaches will work.â RalfFriedl
54 mins ago
According to the
systemd
crowd, systemd
should be used for everything. xinetd
won't cause you any problems. With systemd
you have to write two files, a .service
file and a .socket
file. Both approaches will work.â RalfFriedl
54 mins ago
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
I donâÂÂt think systemd socket activation is significantly better than xinetd
activation, when considered in isolation; the latter is stable too and has been around for longer. Socket activation is really interesting for service decoupling: it allows services to be started in parallel, even if they need to communicate, and it allows services to be restarted independently.
If you have a service which supports xinetd
-style activation, it can be used with socket activation: a .socket
description with Accept=true
will behave in the same way as xinetd
. YouâÂÂll also need a .service
file to describe the service. The full benefits of systemd socket activation require support in the dæmon providing the service. See the blog post on the topic.
My advice tends to be âÂÂif it isnâÂÂt broken, donâÂÂt fix itâÂÂ, but if you want to convert an xinetd
-based service to systemd itâÂÂs certainly feasible.
add a comment |Â
up vote
2
down vote
You can use either xinetd
or systemd
for socket activation, both will work. I personally find xinetd
easier to use because everything is in one file, but have also used systemd
because it is more flexible, especially with listening on multiple addresses and socket forwarding to UNIX sockets and not just to IP sockets.
Here as an example I used to forward TCP connection to the MySQL file socket:
/etc/systemd/system/mysql-proxy.service
[Unit]
Description=MySql Proxy Service
Requires=mysql-proxy.socket
[Service]
Environment=MYSQL_PROXY_TARGET=/var/run/mysql/mysql.sock
EnvironmentFile=-/etc/sysconfig/mysql-proxy
ExecStart=/usr/lib/systemd/systemd-socket-proxyd $MYSQL_PROXY_TARGET
/etc/systemd/system/mysql-proxy.socket
[Unit]
Description=MySql Proxy Socket
[Socket]
ListenStream=192.168.1.1:3306
ListenStream=192.168.2.1:3306
NoDelay=true
FreeBind=true
[Install]
WantedBy=sockets.target
Traditional forwarding needs Accept=true
, systemd
aware processes are supposed to handle multiple connections in one process or fork additional processes as required.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
I donâÂÂt think systemd socket activation is significantly better than xinetd
activation, when considered in isolation; the latter is stable too and has been around for longer. Socket activation is really interesting for service decoupling: it allows services to be started in parallel, even if they need to communicate, and it allows services to be restarted independently.
If you have a service which supports xinetd
-style activation, it can be used with socket activation: a .socket
description with Accept=true
will behave in the same way as xinetd
. YouâÂÂll also need a .service
file to describe the service. The full benefits of systemd socket activation require support in the dæmon providing the service. See the blog post on the topic.
My advice tends to be âÂÂif it isnâÂÂt broken, donâÂÂt fix itâÂÂ, but if you want to convert an xinetd
-based service to systemd itâÂÂs certainly feasible.
add a comment |Â
up vote
2
down vote
accepted
I donâÂÂt think systemd socket activation is significantly better than xinetd
activation, when considered in isolation; the latter is stable too and has been around for longer. Socket activation is really interesting for service decoupling: it allows services to be started in parallel, even if they need to communicate, and it allows services to be restarted independently.
If you have a service which supports xinetd
-style activation, it can be used with socket activation: a .socket
description with Accept=true
will behave in the same way as xinetd
. YouâÂÂll also need a .service
file to describe the service. The full benefits of systemd socket activation require support in the dæmon providing the service. See the blog post on the topic.
My advice tends to be âÂÂif it isnâÂÂt broken, donâÂÂt fix itâÂÂ, but if you want to convert an xinetd
-based service to systemd itâÂÂs certainly feasible.
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
I donâÂÂt think systemd socket activation is significantly better than xinetd
activation, when considered in isolation; the latter is stable too and has been around for longer. Socket activation is really interesting for service decoupling: it allows services to be started in parallel, even if they need to communicate, and it allows services to be restarted independently.
If you have a service which supports xinetd
-style activation, it can be used with socket activation: a .socket
description with Accept=true
will behave in the same way as xinetd
. YouâÂÂll also need a .service
file to describe the service. The full benefits of systemd socket activation require support in the dæmon providing the service. See the blog post on the topic.
My advice tends to be âÂÂif it isnâÂÂt broken, donâÂÂt fix itâÂÂ, but if you want to convert an xinetd
-based service to systemd itâÂÂs certainly feasible.
I donâÂÂt think systemd socket activation is significantly better than xinetd
activation, when considered in isolation; the latter is stable too and has been around for longer. Socket activation is really interesting for service decoupling: it allows services to be started in parallel, even if they need to communicate, and it allows services to be restarted independently.
If you have a service which supports xinetd
-style activation, it can be used with socket activation: a .socket
description with Accept=true
will behave in the same way as xinetd
. YouâÂÂll also need a .service
file to describe the service. The full benefits of systemd socket activation require support in the dæmon providing the service. See the blog post on the topic.
My advice tends to be âÂÂif it isnâÂÂt broken, donâÂÂt fix itâÂÂ, but if you want to convert an xinetd
-based service to systemd itâÂÂs certainly feasible.
answered 45 mins ago
Stephen Kitt
146k22321386
146k22321386
add a comment |Â
add a comment |Â
up vote
2
down vote
You can use either xinetd
or systemd
for socket activation, both will work. I personally find xinetd
easier to use because everything is in one file, but have also used systemd
because it is more flexible, especially with listening on multiple addresses and socket forwarding to UNIX sockets and not just to IP sockets.
Here as an example I used to forward TCP connection to the MySQL file socket:
/etc/systemd/system/mysql-proxy.service
[Unit]
Description=MySql Proxy Service
Requires=mysql-proxy.socket
[Service]
Environment=MYSQL_PROXY_TARGET=/var/run/mysql/mysql.sock
EnvironmentFile=-/etc/sysconfig/mysql-proxy
ExecStart=/usr/lib/systemd/systemd-socket-proxyd $MYSQL_PROXY_TARGET
/etc/systemd/system/mysql-proxy.socket
[Unit]
Description=MySql Proxy Socket
[Socket]
ListenStream=192.168.1.1:3306
ListenStream=192.168.2.1:3306
NoDelay=true
FreeBind=true
[Install]
WantedBy=sockets.target
Traditional forwarding needs Accept=true
, systemd
aware processes are supposed to handle multiple connections in one process or fork additional processes as required.
add a comment |Â
up vote
2
down vote
You can use either xinetd
or systemd
for socket activation, both will work. I personally find xinetd
easier to use because everything is in one file, but have also used systemd
because it is more flexible, especially with listening on multiple addresses and socket forwarding to UNIX sockets and not just to IP sockets.
Here as an example I used to forward TCP connection to the MySQL file socket:
/etc/systemd/system/mysql-proxy.service
[Unit]
Description=MySql Proxy Service
Requires=mysql-proxy.socket
[Service]
Environment=MYSQL_PROXY_TARGET=/var/run/mysql/mysql.sock
EnvironmentFile=-/etc/sysconfig/mysql-proxy
ExecStart=/usr/lib/systemd/systemd-socket-proxyd $MYSQL_PROXY_TARGET
/etc/systemd/system/mysql-proxy.socket
[Unit]
Description=MySql Proxy Socket
[Socket]
ListenStream=192.168.1.1:3306
ListenStream=192.168.2.1:3306
NoDelay=true
FreeBind=true
[Install]
WantedBy=sockets.target
Traditional forwarding needs Accept=true
, systemd
aware processes are supposed to handle multiple connections in one process or fork additional processes as required.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
You can use either xinetd
or systemd
for socket activation, both will work. I personally find xinetd
easier to use because everything is in one file, but have also used systemd
because it is more flexible, especially with listening on multiple addresses and socket forwarding to UNIX sockets and not just to IP sockets.
Here as an example I used to forward TCP connection to the MySQL file socket:
/etc/systemd/system/mysql-proxy.service
[Unit]
Description=MySql Proxy Service
Requires=mysql-proxy.socket
[Service]
Environment=MYSQL_PROXY_TARGET=/var/run/mysql/mysql.sock
EnvironmentFile=-/etc/sysconfig/mysql-proxy
ExecStart=/usr/lib/systemd/systemd-socket-proxyd $MYSQL_PROXY_TARGET
/etc/systemd/system/mysql-proxy.socket
[Unit]
Description=MySql Proxy Socket
[Socket]
ListenStream=192.168.1.1:3306
ListenStream=192.168.2.1:3306
NoDelay=true
FreeBind=true
[Install]
WantedBy=sockets.target
Traditional forwarding needs Accept=true
, systemd
aware processes are supposed to handle multiple connections in one process or fork additional processes as required.
You can use either xinetd
or systemd
for socket activation, both will work. I personally find xinetd
easier to use because everything is in one file, but have also used systemd
because it is more flexible, especially with listening on multiple addresses and socket forwarding to UNIX sockets and not just to IP sockets.
Here as an example I used to forward TCP connection to the MySQL file socket:
/etc/systemd/system/mysql-proxy.service
[Unit]
Description=MySql Proxy Service
Requires=mysql-proxy.socket
[Service]
Environment=MYSQL_PROXY_TARGET=/var/run/mysql/mysql.sock
EnvironmentFile=-/etc/sysconfig/mysql-proxy
ExecStart=/usr/lib/systemd/systemd-socket-proxyd $MYSQL_PROXY_TARGET
/etc/systemd/system/mysql-proxy.socket
[Unit]
Description=MySql Proxy Socket
[Socket]
ListenStream=192.168.1.1:3306
ListenStream=192.168.2.1:3306
NoDelay=true
FreeBind=true
[Install]
WantedBy=sockets.target
Traditional forwarding needs Accept=true
, systemd
aware processes are supposed to handle multiple connections in one process or fork additional processes as required.
answered 36 mins ago
RalfFriedl
3,8651624
3,8651624
add a comment |Â
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f470871%2fsystemd-socket-activation-vs-xinetd%23new-answer', 'question_page');
);
Post as a guest
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
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
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
If both work, use what you are comfortable with.
â RalfFriedl
1 hour ago
@RalfFriedl Good advice, but I'd rather use what is more official/standard - it seems to me that would be socket activation. However I can't find info anywhere stating whether they actually do the same thing, I don't want to run into any problems.
â lonix
1 hour ago
1
According to the
systemd
crowd,systemd
should be used for everything.xinetd
won't cause you any problems. Withsystemd
you have to write two files, a.service
file and a.socket
file. Both approaches will work.â RalfFriedl
54 mins ago