Azure / Azure/azure-linux-extensions
VMAccessForLinux doesn't work with CentOS - needs SSHD.service
- Dominant language
- Python
- Stars
- 333
- Forks
- 278
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 4
Description
CRI 195791142
Trying to reset password on CentOS 8.1 - VMAccessForLinux says:
_[root@vm195791142 Microsoft.OSTCExtensions.VMAccessForLinux]# cat extension.log
...
2020/07/09 13:46:00 [Microsoft.OSTCExtensions.VMAccessForLinux-1.5.6] Config decoded correctly.
2020/07/09 13:46:00 [Microsoft.OSTCExtensions.VMAccessForLinux-1.5.6] set most recent sequence number to 0
2020/07/09 13:46:00 CreateAccount: rdaxelg already exists. Will update password.
2020/07/09 13:46:00 Change user password
2020/07/09 13:46:01 Created user account: rdaxelg
2020/07/09 13:46:01 [Microsoft.OSTCExtensions.VMAccessForLinux-1.5.6] Succeeded in creating the account or setting the password.
2020/07/09 13:46:01 ERROR: CalledProcessError. Error Code is 5
2020/07/09 13:46:01 ERROR: CalledProcessError. Command string was ['/usr/sbin/service', 'ssh', 'restart']
2020/07/09 13:46:01 ERROR: CalledProcessError. Command result was Redirecting to /bin/systemctl restart ssh.service
2020/07/09 13:46:01 ERROR: **Failed to restart ssh.service: Unit ssh.service not found.**
2020/07/09 13:46:01 ERROR: Failed to restart SSH service with return code:5
2020/07/09 13:46:01 [Microsoft.OSTCExtensions.VMAccessForLinux-1.5.6] Enable,success,0,Enable succeeded._
VMAccessForLinux doesn’t work with CentOS - as it tries to restart ssh.service - but CentOS seems to use sshd.service:
_[root@vm195791142 Microsoft.OSTCExtensions.VMAccessForLinux]# systemctl restart ssh.service
**Failed to restart ssh.service: Unit ssh.service not found.**_
_[root@vm195791142 Microsoft.OSTCExtensions.VMAccessForLinux]# systemctl status ssh.service
**Unit ssh.service could not be found.**_
_[root@vm195791142 Microsoft.OSTCExtensions.VMAccessForLinux]# systemctl restart sshd.service_
_[root@vm195791142 Microsoft.OSTCExtensions.VMAccessForLinux]# systemctl status sshd.service
● sshd.service - OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2020-07-09 13:51:38 UTC; 11s ago
Docs: man:sshd(8)
man:sshd_config(5)
Main PID: 1847 (sshd)
Tasks: 1 (limit: 24872)
Memory: 1.2M
CGroup: /system.slice/sshd.service
└─1847 /usr/sbin/sshd -D -oCiphers=aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes256-cbc,aes128-gcm@openssh.com,aes128-ctr,aes128-cbc -oMACs=hmac-sha2-256-etm@openssh.com>_
_Jul 09 13:51:38 vm195791142 systemd[1]: Stopped OpenSSH server daemon.
Jul 09 13:51:38 vm195791142 systemd[1]: Starting OpenSSH server daemon...
Jul 09 13:51:38 vm195791142 sshd[1847]: Server listening on 0.0.0.0 port 22.
Jul 09 13:51:38 vm195791142 sshd[1847]: Server listening on :: port 22.
Jul 09 13:51:38 vm195791142 systemd[1]: Started OpenSSH server daemon._
--> Can you update **azure-linux-extensions/Utils/distroutils.py** ?
Contributor guide
No contributing guide indexed for this repository
Research direction
Open Utils/distroutils.py and trace the SSH service restart used by VMAccessForLinux. Reproduce the failure on CentOS 8.1 if possible, then verify that the extension can restart the system's sshd.service while retaining compatibility with systems using ssh.service.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, centos, python
- Domain
- cloud, operating-systems
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100