1

I've got a server running Ubuntu 18.04, and whenever I login through SSH I receive this at the end of my MOTD:

Command 'syncthing' is available in '/snap/bin/syncthing'
The command could not be located because '/snap/bin' is not included in the PATH environment variable.
syncthing: command not found

I do have Syncthing set up on the server (installed through snap), but I run it using a script that launches it in a screen session (I run this script manually, as far as I know it should not run automatically). Is there anywhere I can check to see why it might be trying to run? I've checked .bashrc but there isn't any entries in there. Any help is appreciated.

Edit:

Running the first suggestion from Terdon's comment printed nothing, and the second command printed the following:

etc/profile.d/01-locale-fix.sh:syncthing

I opened that file, sure enough there was a line with just syncthing. I commented out that line, logged out and back in and the issue was gone.

3
  • Perhaps the motd system is trying to call it for some reason? Please edit your question and add the output of grep -R syncthing /etc/update-motd.d. Then, also post the output of grep syncthing ~/.bashrc ~/.profile ~/.bash_profile ~/bash.login ~/.bash_aliases /etc/bash.bashrc /etc/profile /etc/profile.d/* /etc/environment 2> /dev/null.
    – terdon
    Sep 11, 2019 at 15:49
  • @terdon Edited, looks like the issue is resolved. If you want to post this as a solution I can accept it, thanks for the help!
    – tycrek
    Sep 13, 2019 at 13:59
  • Yay! Glad I could help.
    – terdon
    Sep 13, 2019 at 14:15

1 Answer 1

1

Whenever there's something weird like this going on during shell initialization, your first step should be to examine all of the files that shells read to when starting. Since the various different types of (bash) shell read different files, you can use this command to find the string syncthing in all possibly re;revant files:

grep syncthing ~/.bashrc ~/.profile ~/.bash_profile ~/bash.login \ 
               ~/.bash_aliases /etc/bash.bashrc /etc/profile \ 
               /etc/profile.d/* /etc/environment 2> /dev/null.

In your case, the offending file was one of the files in /etc/profile.d, so just remove or comment the relevant line out and you should be ready to go!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .