How to set up ipfs.service

What am I missing in part 2 on:

Should the installation from kubo not bring ipfs.service aswell?

Running the daemon manually works fine.

What I have set up so far is:

ipfs_UP() {
    # https://wiki.archlinux.org/title/InterPlanetary_File_System
    # Needed for Browser IPFS Extension

    pkg_=(
        kubo
    )
    service=ipfs

    if [[ $(pacman -Su --print-format "%v" | wc -l) -gt 0 ]]; then
        sudo pacman -Sy
    fi
    for pkg in "${pkg_[@]}"; do

        if ! pacman -Qq "$pkg" >/dev/null 2>&1; then
            sudo pacman -Su "$pkg"
        fi
    done

    if ! [[ -e "$XDG_DATA_HOME"/ipfs ]] >/dev/null 2>&1; then
        export IPFS_PATH="$XDG_DATA_HOME"/ipfs

        ipfs init
        ipfs daemon &
        export IPFS_TELEMETRY=off
    else
        ipfs daemon &
        export IPFS_TELEMETRY=off
    fi

    # if systemctl status "$service" | grep "inactive" >/dev/null 2>&1; then
    #     sudo systemctl enable "$service" --now
    # fi
}

and the service workaround

if pacman -Qq "kubo" >/dev/null 2>&1; then
    if ! pgrep -x "ipfs" >/dev/null 2>&1; then
        export IPFS_PATH="$XDG_DATA_HOME"/ipfs
        export IPFS_TELEMETRY=off

        ipfs daemon &
    fi
fi

Yes, it’s included in the package.

Telling us what exactly the problem is. And because of that, we are missing that too. :grin:

What is your problem?

  • Do you not know how to enable a systemd service?
  • Does the service not start when enabled?
  • Are there any error messages?

Help us help you. We’re pretty good at lots of things, but not so much at mindreading. :grin:

the problem is:

❯ systemctl status ipfs.service
Unit ipfs.service could not be found.
❯ pacman -Q |g kubo
kubo 0.39.0-1

According to the package, it would be called ipfs@.service.

thanks that works.

❯ status ipfs@"USER".service
○ ipfs@USER.service - InterPlanetary File System (IPFS) daemon
     Loaded: loaded (/usr/lib/systemd/system/ipfs@.service; disabled; preset: disabled)
     Active: inactive (dead)
1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.