LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-01-2020, 01:45 AM   #1
pathakrajeev1711
LQ Newbie
 
Registered: Apr 2020
Posts: 1

Rep: Reputation: Disabled
start onos service withoud sudo from a non root user


Hi,

I am trying to start/stop onos service from a non root user ubuntu 17.04.

i tried:
i tried creating testuser2/.config/systemd/user/onos.service

[Unit]
Description=Open Network Operating System
After=network-online.target
After=local-fs.target

[Service]
Type=forking
ExecStart=/etc/init.d/onos start
ExecStop=/etc/init.d/onos stop
Restart=always

[Install]
WantedBy=multi-user.target

and tried systemctl --user daemon-reload

it says::
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.656" (uid=1002 pid=19639 comm="start --system onos ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init ")
testuser1@user-ThinkCentre-M73:~$ systemctl --user daemon-reload
-bash: /usr/lib/command-not-found: /usr/bin/python3: bad interpreter: No such file or directory
 
Old 05-02-2020, 10:30 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by pathakrajeev1711 View Post
Hi,

I am trying to start/stop onos service from a non root user ubuntu 17.04.

i tried:
i tried creating testuser2/.config/systemd/user/onos.service

[Unit]
Description=Open Network Operating System
After=network-online.target
After=local-fs.target

[Service]
Type=forking
ExecStart=/etc/init.d/onos start
ExecStop=/etc/init.d/onos stop
Restart=always

[Install]
WantedBy=multi-user.target

and tried systemctl --user daemon-reload

it says::
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.656" (uid=1002 pid=19639 comm="start --system onos ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init ")
testuser1@user-ThinkCentre-M73:~$ systemctl --user daemon-reload
-bash: /usr/lib/command-not-found: /usr/bin/python3: bad interpreter: No such file or directory
Documentation from the Onos site:
https://wiki.onosproject.org/display...S+as+a+service

And I bolded a part of what you posted; did you read that?? Look at the script you're calling, because it's trying to find something that's not in that users path...so you have two options: modify the init script with the full path, or modify the users environment to include the path to the interpreter.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] sudo to user other than root but do not allow sudo to root Westmoreland Linux - Security 4 07-13-2022 01:09 PM
LXer: GPL enforcement, ONOS partners with Linux Foundation, and more news LXer Syndicated Linux News 0 10-18-2015 04:41 AM
LXer: Open Source SDN: OpenDaylight and ONOS Will Collaborate, Executive Says LXer Syndicated Linux News 0 10-14-2015 06:51 PM
LXer: Linux Foundation and ONOS Partner on Open Source SDN and NFV Networks LXer Syndicated Linux News 0 10-13-2015 07:21 PM
sudo non-user/non-root password Alex_Dc Linux - Security 3 02-19-2010 06:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration