Systemd AmbientCapabilities: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
| Zeile 7: | Zeile 7: | ||
[Service] | [Service] | ||
Type=simple | Type=simple | ||
| − | ExecStart=/ | + | ExecStart=/usr/local/bin/prog 9988 |
| − | |||
Restart=always | Restart=always | ||
| − | User= | + | User=xinux |
[Install] | [Install] | ||
| Zeile 23: | Zeile 22: | ||
[Service] | [Service] | ||
Type=simple | Type=simple | ||
| − | ExecStart=/bin/ | + | ExecStart=/usr/local/bin/prog 99 |
| − | + | Restart=always | |
AmbientCapabilities=CAP_NET_BIND_SERVICE | AmbientCapabilities=CAP_NET_BIND_SERVICE | ||
| − | + | User=xinux | |
| − | User= | ||
[Install] | [Install] | ||
WantedBy=default.target | WantedBy=default.target | ||
</pre> | </pre> | ||
Version vom 11. Januar 2023, 12:56 Uhr
Was wollen wir?
- Einen Socket öffnen unter 1024 mit einem normalen Benutzeraccount
[Unit] Description=Simple Unit [Service] Type=simple ExecStart=/usr/local/bin/prog 9988 Restart=always User=xinux [Install] WantedBy=default.target
Wie erreichen wie dies?
- AmbientCapabilities=CAP_NET_BIND_SERVICE fügt diese Fähigkeit hinzu.
[Unit] Description=Simple Unit [Service] Type=simple ExecStart=/usr/local/bin/prog 99 Restart=always AmbientCapabilities=CAP_NET_BIND_SERVICE User=xinux [Install] WantedBy=default.target