Page 1 of 5

How to restart crashed HTTPD server and Transmission?

PostPosted: Mon Mar 10, 2025 12:54 am
by Cubytus
Hi there,

this may sound as a silly question, but how can one restart daemons when they crash? Is there a documentation page for that?

The usual, Linux way would use either
Code: Select all
systemctl
or
Code: Select all
service
commands, but they aren't available in fvdw, so these have to be called directly.

When running, Transmission daemon uses command line
Code: Select all
/usr/local/bin/transmission-daemon -g /share/1000/tr-daemon -w /share/1000/tr-downloads
under user rd

However when I call httpd from the command line with
/usr/bin/httpd -f httpd.conf -d /etc -k start
it runs as user root.

Is that the proper way to restart?

Re: How to restart crashed HTTPD server and Transmission?

PostPosted: Mon Mar 10, 2025 2:44 pm
by fvdw
we don't use systemctl as it increade firmware file a lot.
So yes you should start from the command line using the commands as shown in ps -ef overview.
For apache it is
Code: Select all
/usr/bin/httpd -f httpd.conf -d /etc

There will be then two lines the script to launch httpd is run by root but the apache server is running under user nobdy. This is set in the httpd.conf file
Code: Select all
root      1326     1  0 15:40 ?        00:00:00 /usr/bin/httpd -f httpd.conf -d /etc
nobody    1330  1326  0 15:40 ?        00:00:00 /usr/bin/httpd -f httpd.conf -d /etc

Re: How to restart crashed HTTPD server and Transmission?

PostPosted: Mon Mar 10, 2025 2:56 pm
by Cubytus
Good to know!

Any specific reason Apache is the web server and not another, lighter or faster? I thought it wasn't the most efficient on smaller devices likes the ones fvdw is designed to power.

As for Transmission: is the command correct?

As a suggestion, even if fvdw is GUI-driven, these command lines should be in the documentation, just in case a process crashes.

Re: How to restart crashed HTTPD server and Transmission?

PostPosted: Mon Mar 10, 2025 3:04 pm
by fvdw
all daemons except apache can be stopped and started from the webinterface.

To start or stop a daemon requires more then only running the start or stop command. Therefor it is not recommended to start daemons from the command line but to use the webinterface

Re: How to restart crashed HTTPD server and Transmission?

PostPosted: Tue Mar 11, 2025 9:20 am
by Jocko
Hi Cubytus

Cubytus wrote:Hi there,

this may sound as a silly question, but how can one restart daemons when they crash? Is there a documentation page for that?

The usual, Linux way would use either
Code: Select all
systemctl
or
Code: Select all
service
commands, but they aren't available in fvdw, so these have to be called directly.

When running, Transmission daemon uses command line
Code: Select all
/usr/local/bin/transmission-daemon -g /share/1000/tr-daemon -w /share/1000/tr-downloads
under user rd

However when I call httpd from the command line with
/usr/bin/httpd -f httpd.conf -d /etc -k start
it runs as user root.

Is that the proper way to restart?
As mentioned by Fvdw, you have to use the firmware web interface to cleanly restart Transmission.
Transmission must run as rd to protect the firmware partitions. With transmission you can easily change the downloading location. So if you select a location from a firmware partition, there will be quickly no free space for the firmware.

The user rd can not write on the firmware partition instead of the user root.

Some other environment variables are also set by the firmware before starting Transmission

Re: How to restart crashed HTTPD server and Transmission?

PostPosted: Mon Mar 31, 2025 5:47 pm
by Cubytus
It solved the issue for a while, but now it has returned…

For some reason, Apache stopped accepting connections. I restarted it from the CLI with command line
/usr/bin/httpd -f httpd.conf -d /etc -k start

The Web interface does load, but trying to get to another page just never loads completely:
Captura de Pantalla 2025-03-31 a la(s) 13.45.46 .png


Since it can't load pages, I can't restart daemons from there.

Any way to know what's causing Apache to hang?

Re: How to restart crashed HTTPD server and Transmission?

PostPosted: Tue Apr 01, 2025 3:06 pm
by Jocko
Hi

Currently I think the fimware fails to daemonize httpd or all threads are using with some no-end loops for example and then no new request can be handled by the daemon
Can you post
Code: Select all
ps axf|grep httpd
and
Code: Select all
 netstat -ap|grep httpd


You can also check if there is no error with conf file
Code: Select all
 /usr/bin/httpd -f httpd.conf -d /etc -t

Re: How to restart crashed HTTPD server and Transmission?

PostPosted: Tue Apr 01, 2025 3:43 pm
by Cubytus
Here it is:

Code: Select all
12914 pts/0    R+     0:00          \_ grep httpd
11730 ?        Ss     0:05 /usr/bin/httpd -f /etc/httpd.conf -d /etc -k start
11735 ?        S      0:11  \_ /usr/bin/httpd -f /etc/httpd.conf -d /etc -k start
11742 ?        S      0:02  \_ /usr/bin/httpd -f /etc/httpd.conf -d /etc -k start


and:

Code: Select all
tcp        6      0 :::http                 :::*                    LISTEN      11730/httpd
tcp       95      0 :::4343                 :::*                    LISTEN      11730/httpd


No reported error in httpd.conf.

Re: How to restart crashed HTTPD server and Transmission?

PostPosted: Tue Apr 01, 2025 3:53 pm
by Jocko
Ok
So httpd is daemonized and ports are opened. That would mean the httpd threads are hanged.

Then do
Code: Select all
killall httpd
and check if all processes are stopped
Code: Select all
ps axf|grep httpd


Start again httpd
Code: Select all
/usr/bin/httpd -f httpd.conf -d /etc
and try to load the firmware interface

Re: How to restart crashed HTTPD server and Transmission?

PostPosted: Wed Apr 02, 2025 12:06 am
by Cubytus
Killed httpd process.

Indeed they're stopped:
Code: Select all
13191 pts/0    S+     0:00          \_ grep httpd


Restarting httpd:
Code: Select all
13204 pts/0    S+     0:00          \_ grep httpd
13198 ?        Ss     0:00 /usr/bin/httpd -f httpd.conf -d /etc
13202 ?        S      0:00  \_ /usr/bin/httpd -f httpd.conf -d /etc


Web interface loads on the home page, but refuses to do anything else.
Captura de Pantalla 2025-04-01 a la(s) 20.04.46 .png


On hovering, none of the tabs are clickable.