Giter Site home page Giter Site logo

Comments (10)

mathieu-aubin avatar mathieu-aubin commented on August 21, 2024 2

Thank yourself, for being truly open to the community and what it has to offer.

There are way too many 'opensource' projects which are, really, only 'open' on the surface.

For the benefit of all, we shall keep innovating!

from webp_server_go.

mathieu-aubin avatar mathieu-aubin commented on August 21, 2024 1

I believe it has to do with the kernel you are currently using not allowing the capabilities stated in the service file.

First make sure all is well stopped and ready for modifications and a clean start

systemctl stop webps

Then, comment the following line, in webps.service

AmbientCapabilities=CAP_NET_BIND_SERVICE

And of course, this is followed by a reaload of systemd stuff with

systemctl daemon-reload

and an attempt at restarting your server.

systemctl start webps

If the previous worked, probably you would benefit from running a newer kernel on the machine you are using and if it is out of the question, you could keep running it with the line commented, providing it is not causing any issues that you can see.

This is of course a temporary fix as the service file would likely be overwritten by a future update with a package manager (obviously, you control that when installing manually, right).

For a more permanent solution, you could create a override file with

systemctl edit webps

and adding the following content

[Service]
AmbientCapabilities=

which would in fact nullify whatever value it had in the original service unit file.

from webp_server_go.

BennyThink avatar BennyThink commented on August 21, 2024 1

@noangel2014
I'm doing it fine with non-root user. Ubuntu 18.04 kernel 5.3.0-42-generic. Please inform us with your kernel version, user, owner of files. Bellow is an example. As @mathieu-aubin suggests, it could be kernel capabilities.

☺  ll
total 14M
-rw-rw-r-- 1 benny benny  160 Mar 11 19:32 config.json
drwxrwxr-x 2 benny benny 4.0K Mar 11 19:32 pics
-rwxrwxr-x 1 benny benny  14M Mar 11 19:28 webp-server
-rw-rw-r-- 1 benny benny  391 Mar 11 19:30 webps.service

/opt/webps
☺  cat /lib/systemd/system/webps.service
[Unit]
Description=WebP Server Go
Documentation=https://github.com/webp-sh/webp_server_go
After=nginx.target

[Service]
Type=simple
StandardError=journal
AmbientCapabilities=CAP_NET_BIND_SERVICE
WorkingDirectory=/opt/webps
ExecStart=/opt/webps/webp-server --config /opt/webps/config.json
ExecReload=/bin/kill -HUP $MAINPID
Restart=always
RestartSec=3s


[Install]
WantedBy=multi-user.target

/opt/webps
☺  whoami
benny

☺ uname -a
Linux home 5.3.0-42-generic #34~18.04.1-Ubuntu SMP Fri Feb 28 13:42:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

from webp_server_go.

noangel2014 avatar noangel2014 commented on August 21, 2024 1

I believe it has to do with the kernel you are currently using not allowing the capabilities stated in the service file.

First make sure all is well stopped and ready for modifications and a clean start

systemctl stop webps

Then, comment the following line, in webps.service

AmbientCapabilities=CAP_NET_BIND_SERVICE

And of course, this is followed by a reaload of systemd stuff with

systemctl daemon-reload

and an attempt at restarting your server.

systemctl start webps

If the previous worked, probably you would benefit from running a newer kernel on the machine you are using and if it is out of the question, you could keep running it with the line commented, providing it is not causing any issues that you can see.

This is of course a temporary fix as the service file would likely be overwritten by a future update with a package manager (obviously, you control that when installing manually, right).

For a more permanent solution, you could create a override file with

systemctl edit webps

and adding the following content

[Service]
AmbientCapabilities=

which would in fact nullify whatever value it had in the original service unit file.

Hello, I have run successfully according to your help

[Service]
AmbientCapabilities=

I don't know why, but it's done. Thank you

from webp_server_go.

BennyThink avatar BennyThink commented on August 21, 2024 1

Thanks Mathieu, for your kindly support!

from webp_server_go.

n0vad3v avatar n0vad3v commented on August 21, 2024

Hi, could you try systemctl status webps.service -l and post the full output here?

from webp_server_go.

BennyThink avatar BennyThink commented on August 21, 2024

Hi, could you please tell us which OS you're using? If it is CentOS, is SELinux enabled? And please paste all the service file's content.

from webp_server_go.

mathieu-aubin avatar mathieu-aubin commented on August 21, 2024

As per linux kernel capabilities

... Ambient capabilities were established in k4.3+
Ambient (since Linux 4.3)

Again, what kernel version are you running?

from webp_server_go.

noangel2014 avatar noangel2014 commented on August 21, 2024

@noangel2014
I'm doing it fine with non-root user. Ubuntu 18.04 kernel 5.3.0-42-generic. Please inform us with your kernel version, user, owner of files. Bellow is an example. As @mathieu-aubin suggests, it could be kernel capabilities.

☺  ll
total 14M
-rw-rw-r-- 1 benny benny  160 Mar 11 19:32 config.json
drwxrwxr-x 2 benny benny 4.0K Mar 11 19:32 pics
-rwxrwxr-x 1 benny benny  14M Mar 11 19:28 webp-server
-rw-rw-r-- 1 benny benny  391 Mar 11 19:30 webps.service

/opt/webps
☺  cat /lib/systemd/system/webps.service
[Unit]
Description=WebP Server Go
Documentation=https://github.com/webp-sh/webp_server_go
After=nginx.target

[Service]
Type=simple
StandardError=journal
AmbientCapabilities=CAP_NET_BIND_SERVICE
WorkingDirectory=/opt/webps
ExecStart=/opt/webps/webp-server --config /opt/webps/config.json
ExecReload=/bin/kill -HUP $MAINPID
Restart=always
RestartSec=3s


[Install]
WantedBy=multi-user.target

/opt/webps
☺  whoami
benny

☺ uname -a
Linux home 5.3.0-42-generic #34~18.04.1-Ubuntu SMP Fri Feb 28 13:42:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

[root@MyCloudServer ~]# uname -a
Linux MyCloudServer 3.10.0-229.7.2.el7.x86_64 #1 SMP Tue Jun 23 22:06:11 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

I'm root, running in CentOS Linux release 7.7.1908 (core)

By the way, there's an error in the documentation

./webp-server -dump-systemd > /lib/systemd/system/webp-server.service

webp-server.service is error

./webp-server -dump-systemd > /lib/systemd/system/webp-server.service

from webp_server_go.

mathieu-aubin avatar mathieu-aubin commented on August 21, 2024

Glad this is resolved, happy to have helped

from webp_server_go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.