Skip to content
TheChatArchiveThe Chat Archive
gpt-3.5-turbo-0301· OpenAIAi2 WildChat-4.8M (AI2)

tvalp:~ apk add filebrowser OK: 180 MiB in 140 packages tvalp:~ find / -name filebrowser…

  1. 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

  2. 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.

  3. User

    I need filebrowser as a service, not just a process

  4. Assistant

    In that case, you can create a systemd unit file for filebrowser service. Here are the steps to create the unit file:

    1. Open a text editor and create a new file called filebrowser.service in the /etc/systemd/system directory.

    2. 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.target
    

    Replace /path/to/files with the path to the directory that you want to serve using filebrowser.

    1. Save the file and exit the editor.

    2. Reload the systemd configuration to include the new unit file:

    sudo systemctl daemon-reload
    
    1. Enable the filebrowser service to start at boot time:
    sudo systemctl enable filebrowser.service
    
    1. Start the filebrowser service:
    sudo systemctl start filebrowser.service
    

    Now, 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
    
  5. User

    Im using Alpine Linux with OpenRC there is no systemd

  6. Assistant

    In that case, you can create an OpenRC service for filebrowser. Here are the steps to create the service:

    1. Open a text editor and create a new file called filebrowser in the /etc/init.d/ directory.

    2. 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/files with the path to the directory that you want to serve using filebrowser.

    1. Save the file and exit the editor.

    2. Make the file executable:

    chmod +x /etc/init.d/filebrowser
    
    1. Add the service to the list of services:
    rc-update add filebrowser default
    
    1. Start the service:
    rc-service filebrowser start
    

    Now, 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
    
  7. 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

  8. Assistant

    It seems like your shell cannot find the /etc/init.d/filebrowser script. You can try running the command with a full path:

    /etc/init.d/filebrowser start
    

    If 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 filebrowser process is running:

    ps aux | grep filebrowser
    

    If the process is not running, try running filebrowser directly by typing the following command in the terminal:

    filebrowser -r /path/to/files
    

    Replace /path/to/files with the path to the directory that you want to serve using filebrowser.

  9. User

    I dont need to run it directly i need to run it as a service

  10. Assistant

    In that case, you can still create an init.d script for filebrowser to make it run as a service. Here are the steps you can follow:

    1. Create a new file /etc/init.d/filebrowser with your preferred text editor.
    sudo nano /etc/init.d/filebrowser
    
    1. 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.
    
    1. Replace /path/to/files with the path to the directory that you want to serve using filebrowser.

    2. Make the file executable.

    sudo chmod +x /etc/init.d/filebrowser
    
    1. Add the script to the runlevel and start the service:
    sudo rc-update add filebrowser default
    sudo rc-service filebrowser start
    

    Now, 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
    

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.