Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Systemctl status of ood-daemon.service is error #251

Open
lizhihongTest opened this issue May 4, 2023 · 8 comments
Open

Systemctl status of ood-daemon.service is error #251

lizhihongTest opened this issue May 4, 2023 · 8 comments
Assignees
Labels
bug Something isn't working enhancement improvement to an existing feature Tools CYFS related tools Unix/Linux

Comments

@lizhihongTest
Copy link
Collaborator

I install Linux DIY-OOD, then find that : Systemctl status of ood-daemon.service is error

root :/ood_test# ps -ef | grep -E cyfs/services
root      969956       1  0 20:38 ?        00:00:00 /cyfs/services/ood-daemon/7jMmeXZck8eSjPSkX2FB5LKWvNqMYco3ti4m4mxihssb/bin/ood-daemon --as-monitor
root      970030  969956  8 20:39 ?        00:00:04 /cyfs/services/ood-daemon/7jMmeXZck8eSjPSkX2FB5LKWvNqMYco3ti4m4mxihssb/bin/ood-daemon --start
root      970122  967403  0 20:40 pts/16   00:00:00 grep --color=auto -E cyfs/services
root :/ood_test# 
root :/ood_test# systemctl status ood-daemon.service 
× ood-daemon.service
     Loaded: loaded (/etc/init.d/ood-daemon; generated)
     Active: failed (Result: exit-code) since Thu 2023-05-04 20:34:02 CST; 6min ago
       Docs: man:systemd-sysv-generator(8)
        CPU: 470us

May 04 20:34:02 filecoin2 systemd[1]: Starting ood-daemon.service...
May 04 20:34:02 filecoin2 systemd[969200]: ood-daemon.service: Failed to execute /etc/init.d/ood-daemon: No such file or directory
May 04 20:34:02 filecoin2 systemd[969200]: ood-daemon.service: Failed at step EXEC spawning /etc/init.d/ood-daemon: No such file or directory
May 04 20:34:02 filecoin2 systemd[1]: ood-daemon.service: Control process exited, code=exited, status=203/EXEC
May 04 20:34:02 filecoin2 systemd[1]: ood-daemon.service: Failed with result 'exit-code'.
May 04 20:34:02 filecoin2 systemd[1]: Failed to start ood-daemon.service.
@lizhihongTest lizhihongTest added the bug Something isn't working label May 4, 2023
@lurenpluto
Copy link
Member

What is the version of your linux, probably related to the specific operating system environment?

@weiqiushi weiqiushi added Tools CYFS related tools enhancement improvement to an existing feature Unix/Linux and removed bug Something isn't working DIY-OOD labels May 5, 2023
@weiqiushi
Copy link
Member

This is not a bug, but can be considered for improvement:

ood-daemon takes a monitor dual process mode to keep the ood-daemon service running.

This startup sequence is as follows:

  • ood-daemon process starts
  • not found the monitor process, and the monitor process is started.
  • ood-daemon process exits
  • The monitor process pulls up the ood-daemon process again

This pattern is not very common in linux services. Moreover, ood-installer is started using the traditional init.rc script mode, which does not require monitoring process status

On some systems that support systemd (ubuntu in this case? Am I right?), it tries to do a compatibility with the traditional init script, but apparently it does so incorrectly here ......

Here you can consider replacing the current init script-based startup with a systemd-based one. But considering that init scripts are more widely supported. I'm still hesitant to replace it

@weiqiushi
Copy link
Member

Which popular linux distributions that do not yet support systemd?
I think if systemd is a popular choice around popular linux distributions , switching the startup script to systemd is a better choice.

@lizhihongTest

@lizhihongTest
Copy link
Collaborator Author

@weiqiushi This is caused by your script error: /etc/init.d/ood-daemon

/etc/init.d/ood-daemon
-bash: /etc/init.d/ood-daemon: /bin/sh^M: bad interpreter: No such file or directory

This error message means that the interpreter that is specified in the first line of the file ("/bin/sh") cannot be found. The "^M" at the end of the error message is a carriage return character, which is a remnant of Windows-style line endings (which use a combination of carriage return and line feed characters to indicate the end of a line).

To fix this issue, you can remove the carriage return characters from the file

@lizhihongTest lizhihongTest added the bug Something isn't working label May 5, 2023
@weiqiushi
Copy link
Member

@weiqiushi This is caused by your script error: /etc/init.d/ood-daemon

/etc/init.d/ood-daemon
-bash: /etc/init.d/ood-daemon: /bin/sh^M: bad interpreter: No such file or directory

This error message means that the interpreter that is specified in the first line of the file ("/bin/sh") cannot be found. The "^M" at the end of the error message is a carriage return character, which is a remnant of Windows-style line endings (which use a combination of carriage return and line feed characters to indicate the end of a line).

To fix this issue, you can remove the carriage return characters from the file
The /etc/init.d/ood-daemon.sh file, released via ood-installer, is already has unix line endings from long time ago. You can check this by yourself.
https://github.com/buckyos/CYFS/blob/main/src/tools/ood-installer/res/default/ood-daemon.sh

@weiqiushi
Copy link
Member

Also, if the file /etc/init.d/ood-daemon is invalid, then ood-daemon should not start.

This does not explain the fact that the ood-daemon process exists in your process list.

@lizhihongTest

@lizhihongTest
Copy link
Collaborator Author

The "ood-daemon" process may have been started by "ood-installer" because I ran a DIY-OOD installation package. The error is just caused by the erroneous "^M" character in the script file "/etc/init.d/ood-daemon", and it has no direct relationship with whether the "ood-daemon" process was successfully launched or not.

Pelase you see this error log ,And check your shell code for /etc/init.d/ood-daemon

May 04 20:34:02 filecoin2 systemd[969200]: ood-daemon.service: Failed to execute /etc/init.d/ood-daemon: No such file or directory
May 04 20:34:02 filecoin2 systemd[969200]: ood-daemon.service: Failed at step EXEC spawning /etc/init.d/ood-daemon: No such file or directory

@weiqiushi
Copy link
Member

The DIY OOD installation package on the official website is generated by the internal two Windows CI Agent
where the linux version is generated by wsl compilation on Windows.

On the two Agents, one of them has not modified the autocrlf configuration of git to false (on Windows, this option is true by default)

The ood-installer compiled by this machine will release the ood-daemon.sh file with the wrong line end when installed

it will be fixed after DIY OOD Installer 1.0.1.33

@lurenpluto lurenpluto moved this to 🐞Discovered Bugs in CYFS-Stack & Services May 16, 2023
@lurenpluto lurenpluto added this to the Group-supported Release milestone May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement improvement to an existing feature Tools CYFS related tools Unix/Linux
Projects
Status: 🐞Discovered Bugs
Development

No branches or pull requests

3 participants