Erreurs lors de l'installation d'un certificat let's encrypt

Bonjour,

lors d’une installation d’un certificat let’s encrypt sur un domaine, 2 erreurs sont remontées. Le certificat a bien été obtenu et semble installé correctement. C’est une installation fraîche de Yunohost, cette installation de certificat est la première opération réalisée après la post installation. C’est peut-être révélateur d’autre chose ?

Merci de votre lecture et de vos avis.

sudo yunohost domain cert-install DOMAIN.tld
Info: Now attempting install of certificate for domain DOMAIN.tld!
Success! The SSOwat configuration has been generated
Success! The configuration has been updated for category 'dnsmasq'
Warning: sudo: service: command not found
Error: Script execution failed: /usr/share/yunohost/hooks/conf_regen/43-dnsmasq
Info: Parsing account key...
Info: Parsing CSR...
Info: Found domains: DOMAIN.tld
Info: Getting directory...
Info: Directory found!
Info: Registering account...
Info: Registered!
Info: Creating new order...
Info: Order created!
Info: Verifying DOMAIN.tld...
Info: DOMAIN.tld verified!
Info: Signing certificate...
Info: Certificate signed!
Success! The configuration has been updated for category 'nginx'
Warning: sudo: service: command not found
Error: Script execution failed: /usr/share/yunohost/hooks/conf_regen/15-nginx
Success! Successfully installed Let's Encrypt certificate for domain DOMAIN.tld!

Hmmm, est-ce que faire apt install sysvinit-utils installe bien un nouveau paquet, et est-ce qu’apres ça si tu fais service reload nginx ça dit toujours que la commande n’existe pas ?

Nope et nope, pas mieux

admin@machine:~$ sudo apt install sysvinit-utils
Reading package lists... Done
Building dependency tree       
Reading state information... Done
sysvinit-utils is already the newest version (2.88dsf-59.9).
The following packages were automatically installed and are no longer required:
  net-tools python3-prettytable
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
admin@machine:~$ sudo service nginx reload
sudo: service: command not found

J’ai quand même l’impression qu’il y a un truc qui ne s’est pas bien déroulé au moment de l’installation

sudo yunohost tools diagnosis
Traceback (most recent call last):
  File "/usr/bin/yunohost", line 214, in <module>
    timeout=opts.timeout,
  File "/usr/lib/python2.7/dist-packages/moulinette/__init__.py", line 136, in cli
    moulinette.run(args, output_as=output_as, password=password, timeout=timeout)
  File "/usr/lib/python2.7/dist-packages/moulinette/interfaces/cli.py", line 425, in run
    ret = self.actionsmap.process(args, timeout=timeout)
  File "/usr/lib/python2.7/dist-packages/moulinette/actionsmap.py", line 523, in process
    return func(**arguments)
  File "/usr/lib/moulinette/yunohost/tools.py", line 795, in tools_diagnosis
    stderr=subprocess.STDOUT)
  File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Yep, et le symptome / cause principal semble etre que la commande “service” n’existe pas …

Est-ce que tu peux tenter service nginx reload (en root, sans sudo)

Ou bien encore de reinstaller le paquet mentionne precedemment:

apt install sysvinit-utils --reinstall

(et de retenter la commande)

Ah intéressant. En root tout passe, mais pas avec le user admin + sudo

Hmokay, tu peux faire un which service ? (en root)

root@machine:/home/admin# which service
/usr/sbin/service

Oooké, et un sudo cat /etc/sudoers | grep path ?

root@machine:/home/admin# sudo cat /etc/sudoers | grep path
root@machine:/home/admin# 

Uuuuh wokay, so now that is weird …

Could you share the content of /etc/sudoers (command : cat /etc/sudoers) ? There’s no private data in it so that’s safe to share. E.g. mine looks like this :

# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults	env_reset
Defaults	mail_badpass
Defaults	secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root	ALL=(ALL:ALL) ALL

# Allow members of group sudo to execute any command
%sudo	ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d


Hello

Forcément, ça va moins bien marcher :smiley:

cat /etc/sudoers
# See sudoers(5) for more information on "#include" directives:

# Added by cloud-init v. 18.3-9-g2e62cb8a-0ubuntu1~18.04.2 on Fri, 10 Aug 2018 11:08:11 +0000
#includedir /etc/sudoers.d

Au final, j’ai réinstallé, il n’y avait encore rien sur le serveur. Je n’étais pas très serein avec l’installationexistante.
Après réinstallation du système par le fournisseur du VPS, j’ai constaté que le fichier des sudoers était vide dès l’origine. En fait, c’est le package sudo qui n’est pas installé du tout par le fournisseur. Curieusement, la commande sudo ne renvoyait pas d’erreur à ce niveau. No problem désormais

Merci @Aleks pour le guidage

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.