tvalp:~ apk add filebrowser OK: 180 MiB in 140 packages tvalp:~ find / -name filebrowser…
- User
tvalp:~ apk add filebrowser OK: 180 MiB in 140 packages
tvalp:~ find / -name filebrowser /etc/init.d/filebrowser
tvalp:~ /etc/init.d/filebrowser start -ash: /etc/init.d/filebrowser: not found
- Assistant
It seems like the installation of filebrowser was successful, but the startup script (/etc/init.d/filebrowser) cannot be found.
You can try reinstalling filebrowser or checking if there is a different startup script location. You can also try running the filebrowser directly by typing "filebrowser" in the terminal.
- User
I need filebrowser as a service, not just a process
- Assistant
In that case, you can create a systemd unit file for filebrowser service. Here are the steps to create the unit file:
-
Open a text editor and create a new file called
filebrowser.servicein the /etc/systemd/system directory. -
Add the following content to the file:
[Unit] Description=File Browser service After=network.target [Service] User=root ExecStart=/usr/bin/filebrowser -r /path/to/files ExecReload=/bin/kill -HUP $MAINPID Restart=always [Install] WantedBy=multi-user.targetReplace
/path/to/fileswith the path to the directory that you want to serve using filebrowser.-
Save the file and exit the editor.
-
Reload the systemd configuration to include the new unit file:
sudo systemctl daemon-reload- Enable the filebrowser service to start at boot time:
sudo systemctl enable filebrowser.service- Start the filebrowser service:
sudo systemctl start filebrowser.serviceNow, filebrowser should start as a service and will be automatically started during system boot. You can check the status of the service using the following command:
sudo systemctl status filebrowser.service -
- User
Im using Alpine Linux with OpenRC there is no systemd
- Assistant
In that case, you can create an OpenRC service for filebrowser. Here are the steps to create the service:
-
Open a text editor and create a new file called
filebrowserin the/etc/init.d/directory. -
Add the following content to the file:
#!/sbin/openrc-run command=/usr/bin/filebrowser command_args="-r /path/to/files" pidfile=/run/filebrowser.pid name=filebrowser depend() { need net before nginx } start_pre() { checkpath --directory --mode 0755 $pidfile touch $pidfile chown root: $pidfile } start() { ebegin "Starting File Browser service" start-stop-daemon --background --make-pidfile --pidfile $pidfile --start --exec $command -- $command_args eend $? } stop() { ebegin "Stopping File Browser service" start-stop-daemon --user root --stop --pidfile $pidfile --retry 5 eend $? }Replace
/path/to/fileswith the path to the directory that you want to serve using filebrowser.-
Save the file and exit the editor.
-
Make the file executable:
chmod +x /etc/init.d/filebrowser- Add the service to the list of services:
rc-update add filebrowser default- Start the service:
rc-service filebrowser startNow, filebrowser should start as a service and will be automatically started during system boot. You can check the status of the service using the following command:
rc-service filebrowser status -
- User
I already have init.d created and with right permissions tvalp:~ find / -name filebrowser /etc/init.d/filebrowser
tvalp:~ /etc/init.d/filebrowser start -ash: /etc/init.d/filebrowser: not found
- Assistant
It seems like your shell cannot find the
/etc/init.d/filebrowserscript. You can try running the command with a full path:/etc/init.d/filebrowser startIf this still does not work, you may need to check if the script is executable or whether any dependencies required by filebrowser are missing. You can also try running the following command to see if the
filebrowserprocess is running:ps aux | grep filebrowserIf the process is not running, try running filebrowser directly by typing the following command in the terminal:
filebrowser -r /path/to/filesReplace
/path/to/fileswith the path to the directory that you want to serve using filebrowser. - User
I dont need to run it directly i need to run it as a service
- Assistant
In that case, you can still create an init.d script for
filebrowserto make it run as a service. Here are the steps you can follow:- Create a new file
/etc/init.d/filebrowserwith your preferred text editor.
sudo nano /etc/init.d/filebrowser- Add the following content to the file:
#!/sbin/openrc-run command="/usr/bin/filebrowser" command_args="-r /path/to/files" pidfile="/var/run/filebrowser.pid" name="filebrowser" depend() { # Add your service's dependencies here. after net } start_pre() { # Create the pid file directory. checkpath -q -m 0755 -o root: /var/run } start() { # Start the daemon. Note: if the -b option is used, the code in the # start function will be run twice (once for the forked process and # once for the shell script), so it should be idempotent (i.e. not # cause problems if run twice). start-stop-daemon --start --quiet \ --background --exec "${command}" \ --name "${name}" --pidfile "${pidfile}" \ -- ${command_args} } stop() { # Stop the daemon. echo "Stopping food service" start-stop-daemon --stop --quiet \ --exec "${command}" \ --name "${name}" --pidfile "${pidfile}" } finish() { # Clean up any temporary files, etc., upon service stop. rm -f "${pidfile}" } # Call the OpenRC script helper system. depend() { # Add any service dependencies, e.g. net. after net } # Run the OpenRC script helper system.-
Replace
/path/to/fileswith the path to the directory that you want to serve using filebrowser. -
Make the file executable.
sudo chmod +x /etc/init.d/filebrowser- Add the script to the runlevel and start the service:
sudo rc-update add filebrowser default sudo rc-service filebrowser startNow, filebrowser should start as a service and will be automatically started during system boot. You can check the status of the service using the following command:
sudo rc-service filebrowser status - Create a new file
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.