Command not found

I successfully building my first snap.
But after installation, I can not run it:

$ vizd
vizd: command not found
$ which vizd

I started looking for executables, and found the following:

$ ls -l
total 28
lrwxrwxrwx 1 root root 13 ноя 15 17:07 viz.vizd -> /usr/bin/snap
lrwxrwxrwx 1 root root 13 ноя 15 17:07 viz.vizd-replay-blockchain -> /usr/bin/snap
lrwxrwxrwx 1 root root 13 ноя 15 17:07 viz.vizd-replay-corrupted -> /usr/bin/snap

Why are their names written in “.”

My snapcraft.yaml:

name: viz
version: '1.2.3'
summary: Seed node for VIZ network
description: |
  Seed node for support VIZ network

grade: devel
confinement: devmode

    command: vizd --resync
    command: vizd --replay-blockchain
    command: vizd --replay-if-corrupted

    plugin: cmake
       - -DCMAKE_BUILD_TYPE=Release

    override-pull: |
       git clone .
       git checkout mainnet-dev
       git submodule update --init --recursive
       - build-essential
       - autoconf
       - automake
       - cmake
       - g++
       - libssl-dev
       - libtool
       - make
       - pkg-config
       - python3
       - python3-jinja2
       - libboost-chrono-dev
       - libboost-context-dev
       - libboost-coroutine-dev
       - libboost-date-time-dev
       - libboost-filesystem-dev
       - libboost-iostreams-dev
       - libboost-locale-dev
       - libboost-program-options-dev
       - libboost-serialization-dev
       - libboost-signals-dev
       - libboost-system-dev
       - libboost-test-dev
       - libboost-thread-dev
       - doxygen
       - libncurses5-dev
       - libreadline-dev
       - perl

1 Like

They are namespaced to the snap name by default, they should be found on the system as

  • viz.vizd
  • viz.vizd-replay-blockchain
  • viz.vizd-replay-corrupted

If you rename your snap to vizd, they will be exposed as:

  • vizd
  • vizd.vizd-replay-blockchain
  • vizd.vizd-replay-corrupted

Given the rule of snap name and app name that match, get a top level name.

The rules are explained on

1 Like

I’d go a step further and suggest you call the apps vizd, replay-blockchain, and replay-corrupted; then with the snap called vizd they’d be exposed as vizd, vizd.replay-blockchain and vizd.replay-corrupted.

On the other hand if the d in vizd is for daemon, and you intend for it to be a system service, you could call the snap viz and the service app daemon, and have viz.daemon

Yes, in the future I was planning. Thanks for the tip!

Thanks for the tip! I figured it out.