Command not found

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

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

parts:
  viz:
    plugin: cmake
    configflags:
       - -DCMAKE_BUILD_TYPE=Release

    override-pull: |
       git clone https://github.com/VIZ-World/viz-world.git .
       git checkout mainnet-dev
       git submodule update --init --recursive
       
    build-packages:
       - 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 https://docs.snapcraft.io/snapcraft-app-and-service-metadata/8335

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.