Home Node startup script

Dang, I had it all working nicely but noticed it was using a daft path for storage. So I stopped nodes and then changed the path during the next “Start nodes”.

It is now running, but the logfile shows no peer ids:

start node

node start canceled due to timer

antnode0001,,0.4.4,RUNNING
antnode0002,,0.4.4,RUNNING
antnode0003,,0.4.4,RUNNING
antnode0004,,0.4.4,RUNNING
antnode0005,,0.4.4,RUNNING
antnode0006,,0.4.4,RUNNING
antnode0007,,0.4.4,RUNNING

Meanwhile ps aux | grep antnode shows that no antnode’s are running.

Any idea what’s going on!

1 Like

paste your /var/antctl/config file please.
I don’t need to tell you to hide the wallet address but I do.

being able to use a different path was a pr from @ambled so I never tested it. The default path should be the same as antctl uses.

If no peer id shows up then the node never started so the peer ID could not be saved.

2 Likes

I guess my choosing a different path is preventing the node from starting. I will investigate that. Thanks for the clues.

1 Like

I guess to be overly clear, make sure the path you use is writable by the anm user

1 Like

This is what’s odd. I chose a path in /home/anm because the home partition is where all the free space is. So although it looks like changing the path should be the issue… but not that simple!

Perhaps just use the defaults but symlink /var/antctl/services to /home/ant?

1 Like

Before trying the symlink suggestion I checked and find that within /home/ant/antctl anm has stored the antnode executable in each node subdirectory, but nothing else. This makes me think the path might still be wrong somewhere and that it isn’t taking the value I’ve used in the anm setup.

I don’t want to get into debugging the scripts so will try the symlink and see how that goes.

EDIT: that makes no difference. Nodes still lack a peer id though the config and other files are created in /home/anm/antctl so I’m going back to leaving the path as the default after removing the symlink to see if that works again.

Ok, so:

  • using the default path /var/antctl/services works
  • using a different path than /var/antctl/services (eg /home/anm/antctl/services) does not work
  • creating a symlink /var/antctl → /home/anm/antctl while using the default path /var/antctl/services does not work

That’s odd :thinking: Both cases that don’t work fail to start a node, so I guess that’s where I’m missing something.

So odd I thought I better go through that again to check and the above is correct. So what am I missing?!

apologies, the default username is ant not anm, I was at work when I replied.

the symlink method has an issue when you tear down a cluster and you have to recreate it before each new cluster, that’s why my PR allowed me to use a separate path.

I cant run nodes right now, so I can’t test but can you see if the node launch process itself is working on Debian?

systemctl status antnode0001

Thanks.

I’m on Ubuntu 24 now and it works if I use the defaults without a symlink. So I stop nodes and set up a symlink and it doesn’t work. It also doesn’t work if I choose a different path, but that’s not surprising because…

I did a grep of the script yesterday and see /var is hardcoded throughout. So I will try using a copy and modifying it to point where I want.

anm is the correct user btw :smiley:

1 Like

interesting about the path. my PR uses sed to overwrite the paths in the anms.sh script and was working great until last month.

I’m glad it’s working!

oh, I forgot something.

I used a subdirectory of the mount point (eg: /mnt/amn mount point, /mnt/amn/services as destination path) because the mount point has a lost+found folder for fsck and that messes up anm node count

2 Likes

It doesn’t work if I choose a custom path. I may just rework the two scripts to hard code my setup as I don’t need the UI.

2 Likes

@ambled @aatonnomicc Quick question: is there an easy way to use local (modified) versions of anm/anms scripts?

If not I plan to add support for an environment variable ANM_SCRIPT_DIR which if it points to a directory containing either of the scripts, will use that rather than the one downloaded automatically.

I can’t see an existing way to do this but want to check before messing about!

1 Like

Think it’s called location or something like that which tells it to use the fit hub location of the scripts.

Should be near the top of I remember correctly.

On a plane right now so can have a look and confirm later.

2 Likes

Thanks. This seemed like it should be quite simple but I keep getting in a mess :rofl: I might just give up and stick with running antctl manually.

I think I have it sorted. Problem was the user specified in the service file (ant) didn’t have permission to run the antnode executable, so changed the node storage path to /home/ant/nodes and it is now able to start them up.

Thanks for your help folks.

3 Likes

Glad you figured it out :slight_smile:

Hopefully going to get time to start making an updated version soon :slight_smile:

2 Likes

After a few more tweaks I’ve pushed a branch below that seems to work, though I’ve not tried upgrading yet.

I’ve modified it for my own setup, but it also includes some minor bugfixes that avoid some error emails from cron (e.g. if you don’t have the overrides or wallet files in place. Another avoids an error about TERM not being set).

As it is slightly specific to my use (now using a user called ‘ant’ as @ambled had in part so that I can store nodes in /home/ant/nodes/) I won’t submit it as a PR but you might find a diff helpful unless you intend a big rewrite).

3 Likes