A newly installed Node launchpad fails to run nodes as root

Hi there, I am trying to understand what has changed that when running Node Launchpad as root, creates nodes data directory in /root/.local/share/ ? This doesn’t work because user ant won’t be able to access this directory. I’m trying to fix this through a PR but i was wondering how would it run earlier. I have the following questions:

  • would it create node data directory in /var/antctl/services(found references to this path in the code, hence assuming).
  • what about windows platform, what would be equivalent to /var/antctl/services?. have we defined default a path for nodes data directory?

I think it’s been designed not to run as root as it’s meant to be beginner friendly.

2 Likes

Yes it is not meant to be run as root as the directories will be messed up

Can you expand a bit about directories getting messed up? If all of the nodes data goes into a specific directory and proper permissions are given to the ant user, isn’t this viable?

Furthermore, without root, the antnode service stops when user logs out from the machine.

Installing Launchpad as root means the files went to root’s directories, but launchpad wants files in the users directories

You can set up a separate dedicated node user account. Then you have isolation and security.

1 Like

That is a bug in my opinion. Node files should reside in a directory that is accessible to the user ant. If we fix this, running as root should just work.

I guess that should be done by the app and i am pretty sure app creates a user called ant specifically for nodes. I would debug it a bit more to know the following

  • even if we create a dedicated user for nodes, the node service is tied to the user session - meaning that when you logout, the service will be stopped

And why would you run as root?

Its designed as a user mode app, thus more secure for the operator.

The problem was not the running as root but the running as root and user mode it would seem.

Thats why it is best to just run all of autonomi in a user account without using root (sudo)

2 Likes

I run as root because that is an option and supported by the launchpad. Running as a normal user still requires me do additional work of making sure that the process doesn’t get terminated when i log out from the machine i.e. when i login(through ssh) and start a node, the node service is attached to the ssh session and gets terminated after sometime - this is what i observed so far

hmm, I am not aware of this. If so then it should be isolated from your normal user session.

No … Service/system users don’t have a session. Instead, a service manager like systemd directly launches the service’s process. The service runs as the specified user, but without a full login session.

Some references:

I will check this further

1 Like

Apparently the user ant is a user not a service account, its id on my machine is 1001

1 Like

Okay … I thought that was likely the case, as it would require to be installed with superuser privileges (sudo or root). So the :ant: team haven’t yet created the option to configure nodes as proper services … I expect they will get to that later down the track.

You could still create another normal user and then just lock the session, leaving it active - then you can just switch in and out of the session as you require. Not as as elegant, but doable now I suppose.

Thanks. Will try that