Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: The automated install script netclient-install.sh does not create the service file. #59

Open
prouveyrol opened this issue Jun 22, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@prouveyrol
Copy link

prouveyrol commented Jun 22, 2022

Contact Details

No response

What happened?

Running

curl -sfL https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/netclient-install.sh | KEY=<sometoken> sh -

On a fresh ubuntu 22.04 server, does not create the service file.

Looking at the script, at line 216 we see : 

if [ "${OS}" = "OpenWRT" ]; then
        mv ./netclient /sbin/netclient
        cat << 'END_OF_FILE' > ./netclient.service.tmp
        
        <some init file>
        
END_OF_FILE
        mv ./netclient.service.tmp /etc/init.d/netclient
        chmod +x /etc/init.d/netclient
        /etc/init.d/netclient enable
        /etc/init.d/netclient start
else
        rm -f netclient
fi

But in the case of an amd64 distro, it simply downloads the binary (not the deb), and runs the join, without creating the service file.

Considering lines 12 to 52, I think that you either were using packages in the past, or are planning to. But currently, the script as is does not function as expected, as the netclient will not be restarted upon reboot. It is not even moved to /usr/bin so trying to run netclient leave… will not work either, as the binary sits where the script was run.

Version

v0.14.3

What OS are you using?

Linux

Relevant log output

[netclient] 2022-06-22 09:42:40 joining testnet at api.netmaker.<mydomain>.systems:443
[netclient] 2022-06-22 09:42:40 starting wireguard
[netclient] 2022-06-22 09:42:42 certificates/key saved
[netclient] 2022-06-22 09:42:42 sent a node update to server for node <myservername> ,  <uuid>
[netclient] 2022-06-22 09:42:44 error running command: systemctl restart netclient.service
[netclient] 2022-06-22 09:42:44 Failed to restart netclient.service: Unit netclient.service not found.


### Contributing guidelines

- [X] Yes, I did.
@prouveyrol prouveyrol added the bug Something isn't working label Jun 22, 2022
@afeiszli
Copy link
Contributor

afeiszli commented Jun 22, 2022

netclient-install.sh is no longer the recommended install path as of 0.14.3. Instead, use the appropriate package installer instructions:

https://docs.netmaker.org/netclient.html#install

If you are installing from a downloaded netclient, you can add the daemon doing the following:

netclient join -t (token) --daemon=install

@prouveyrol
Copy link
Author

Thanks, that is what I ended up doing.
I can swear I read this somewhere in some doc here https://netmaker.readthedocs.io, but I am now unable to find it again.

All good. I'm closing the issue.

@prouveyrol
Copy link
Author

Found it again.
https://netmaker.readthedocs.io/en/master/getting-started.html#deploy-nodes

Item 4 here. You might want to correct the doc to mention this page instead.

Best regards, and thanks for the awesome product.

@prouveyrol prouveyrol reopened this Jun 22, 2022
@afeiszli
Copy link
Contributor

Thanks! If you're interested, you can make a PR to fix the docs here: https://github.com/gravitl/netmaker-docs

Otherwise, I will try to have that in with the next release.

@mattkasun mattkasun transferred this issue from gravitl/netmaker Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants