Spectrum SRAdmin script sra_nonroot_prepost_install.sh fails with "Failed to connect to bus: No such file or directory"
search cancel

Spectrum SRAdmin script sra_nonroot_prepost_install.sh fails with "Failed to connect to bus: No such file or directory"

book

Article ID: 385688

calendar_today

Updated On:

Products

Network Observability Spectrum

Issue/Introduction

When running the Spectrum SRAdmin script sra_nonroot_prepost_install.sh on Linux, it fails with the following error:

 

sudo ./sra_nonroot_prepost_install.sh -debug
[sudo] password for user:
Please enter 1 for executing preinstallation steps
      or 2 for post installation steps
      or 3 for pre upgrade steps
Enter now
2
Here to execute PostInstallation Steps
SRAdmin home directory /sw/SPECTRUM/SRAdmin
SRAdmin Install owner caadmin
Stopping the sradmin daemon from unregister_init_sradmin
Failed to connect to bus: No such file or directory
Failed to connect to bus: No such file or directory
Executing Postinstallation Steps Has Ended

Environment

Release : Any
Component : Spectrum Install/SRAdmin

Cause

Lingering was not enabled for the non-root user spectrum. 

Resolution

Enabling lingering for the non-root spectrum user:

Enabled lingering for the non root user 'spectrum':
```

Example:


$ sudo loginctl enable-linger spectrum
$ sudo loginctl show-user spectrum
UID=1001
GID=1002
Name=spectrum
Timestamp=Tue 2025-01-07 18:53:07 GMT
TimestampMonotonic=2974926144638
RuntimePath=/run/user/1001
[email protected]
Slice=user-1001.slice
State=lingering
Sessions=
IdleHint=yes
IdleSinceHint=0
IdleSinceHintMonotonic=0
Linger=yes

After lingering is enabled for the user, do the following:

1. Stop sradmin process
 
2.Switch to root user
3. loginctl enable-user < non root user name >
4. Run the sra_nonroot_prepost_install.sh post installation method (step 2)
5. switch to non root user and check the sradmin status using systemctl
    systemctl --user status sradmin
 
Now the user should be able to stop/start the sradmin process using the systemctl command.

Additional Information

A workaround is to use sradmin --start and sradmin --stop commands to start and stop the sradmin process.