Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] How do I get a new service running?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
roboto
Apprentice
Apprentice


Joined: 15 Feb 2017
Posts: 156
Location: My IP address.

PostPosted: Fri Apr 14, 2017 10:07 pm    Post subject: [SOLVED] How do I get a new service running? Reply with quote

When I needed to start a service at boot e.g. sshd:

rc-update add sshd default

The output is this:

* rc-update: service 'sshd' does not exist

I tried:

service sshd start

* service: service 'sshd' does not exist

So how do I make sshd existent and start it? Sorry for being such a noob. :oops:
_________________
Answers please.

The true hater of man expects nothing from him and is indiscriminate to his works.
-Ayn Rand
Quote:
Dude. Minus 30 credibility points.

Yep


Last edited by roboto on Sat Apr 15, 2017 12:51 am; edited 1 time in total
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Fri Apr 14, 2017 10:48 pm    Post subject: Reply with quote

roboto ...

Code:
# equery belongs -e /etc/init.d/sshd
net-misc/openssh-7.3_p1-r7 (/etc/init.d/sshd)

So, I expect this isn't installed.

best ... khay
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 6053
Location: Removed by Neddy

PostPosted: Fri Apr 14, 2017 10:49 pm    Post subject: Reply with quote

by ensuring openssh is installed

equery belongs /etc/init.d/sshd
* Searching for /etc/init.d/sshd ...
net-misc/openssh-7.5_p1-r1 (/etc/init.d/sshd)
_________________
Quote:
Removed by Chiitoo
Back to top
View user's profile Send private message
roboto
Apprentice
Apprentice


Joined: 15 Feb 2017
Posts: 156
Location: My IP address.

PostPosted: Fri Apr 14, 2017 10:58 pm    Post subject: Reply with quote

openssh is installed.

equery belongs /etc/init.d/sshd
* Searching for /etc/init.d/sshd ...
net-misc/openssh-7.3_p1-r7 (/etc/init.d/sshd)

Edit: I am able to ssh into other computers, but others can't ssh into my computer. I think that is due to the absence of sshd.
_________________
Answers please.

The true hater of man expects nothing from him and is indiscriminate to his works.
-Ayn Rand
Quote:
Dude. Minus 30 credibility points.

Yep
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 6053
Location: Removed by Neddy

PostPosted: Fri Apr 14, 2017 11:22 pm    Post subject: Reply with quote

equery searches the installation database. If you cannot add the service could it have been deleted?

stat /etc/init.d/sshd
File: /etc/init.d/sshd
Size: 2108 Blocks: 8 IO Block: 4096 regular file
Device: 801h/2049d Inode: 1262516 Links: 1
Access: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2017-04-04 22:31:40.558909272 +0100
Modify: 2017-04-04 22:31:40.558909272 +0100
Change: 2017-04-04 22:32:02.188909249 +0100
Birth: -
_________________
Quote:
Removed by Chiitoo
Back to top
View user's profile Send private message
roboto
Apprentice
Apprentice


Joined: 15 Feb 2017
Posts: 156
Location: My IP address.

PostPosted: Fri Apr 14, 2017 11:26 pm    Post subject: Reply with quote

stat /etc/init.d/sshd
stat: cannot stat '/etc/init.d/sshd': No such file or directory


Do I create an sshd file then?

Edit: I created the file:

rc-update add sshd default
* rc-update: service `sshd' is not executeable

How do I make it executable?
_________________
Answers please.

The true hater of man expects nothing from him and is indiscriminate to his works.
-Ayn Rand
Quote:
Dude. Minus 30 credibility points.

Yep


Last edited by roboto on Fri Apr 14, 2017 11:28 pm; edited 1 time in total
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Fri Apr 14, 2017 11:27 pm    Post subject: Reply with quote

roboto wrote:
openssh is installed.

roboto ... so what are you not telling us? ;)

Code:
# ls -l /etc/init.d/sshd
-rwxr-xr-x 1 root root 2114 2016-12-09 21:39 /etc/init.d/sshd
# rc update add sshd default
 * service sshd added to runlevel default
# rc-update del sshd default
 * service sshd removed from runlevel default

So, it works here ... what version of openrc, and what other specifics relating to your install should we know about?

best ... khay
Back to top
View user's profile Send private message
roboto
Apprentice
Apprentice


Joined: 15 Feb 2017
Posts: 156
Location: My IP address.

PostPosted: Fri Apr 14, 2017 11:31 pm    Post subject: Reply with quote

OpenRC version: 0.23.2

I created the sshd file in /etc/init.d/sshd but I do not know how to make it executable.
_________________
Answers please.

The true hater of man expects nothing from him and is indiscriminate to his works.
-Ayn Rand
Quote:
Dude. Minus 30 credibility points.

Yep
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Fri Apr 14, 2017 11:54 pm    Post subject: Reply with quote

roboto wrote:
I created the sshd file in /etc/init.d/sshd but I do not know how to make it executable.

roboto ... as was shown above that file comes as part of net-misc/openssh, so if you've "created" it then you've probably trashed the one that came with the package, either re-merge the pacakage or do the following:

Code:
# cp /usr/portage/net-misc/openssh/files/sshd.rc6.4 /etc/init.d/sshd
# chown root:root /etc/init.d/sshd
# chmod u+rwx,go+rx /etc/init.d/sshd
# rc-update add sshd default

best ... khay
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Fri Apr 14, 2017 11:56 pm    Post subject: Reply with quote

roboto wrote:
I created the sshd file in /etc/init.d/sshd but I do not know how to make it executable.


Code:
X3 ~ # equery f openssh |grep etc
/etc
/etc/conf.d
/etc/conf.d/sshd
/etc/init.d
/etc/init.d/sshd
/etc/pam.d
/etc/pam.d/sshd
/etc/skel
/etc/skel/.ssh
/etc/ssh
/etc/ssh/moduli
/etc/ssh/ssh_config
/etc/ssh/sshd_config

X3 ~ # ls -l /etc/init.d/sshd
-rwxr-xr-x 1 root root 2115 Feb 13 03:33 /etc/init.d/sshd
The ebuild should have installed it. Are you sure you are not running systemd?
Back to top
View user's profile Send private message
roboto
Apprentice
Apprentice


Joined: 15 Feb 2017
Posts: 156
Location: My IP address.

PostPosted: Sat Apr 15, 2017 12:03 am    Post subject: Reply with quote

The command you suggested did not work... the sshd file is not executable.

I am not running systemd, rather, I am running OpenRC and besides, I disabled systemd support in the kernel config.

equery f openssh |grep etc
/etc
/etc/conf.d
/etc/conf.d/sshd
/etc/init.d
/etc/init.d/sshd
/etc/pam.d
/etc/pam.d/sshd
/etc/skel
/etc/skel/.ssh
/etc/ssh
/etc/ssh/moduli
/etc/ssh/ssh_config
/etc/ssh/sshd_config

ls -l /etc/init.d/sshd
-rw-r--r-- 1 root root 0 Apr 14 18:26 /etc/init.d/sshd

rc-update add sshd default
* rc-update: service `sshd' is not executeable
_________________
Answers please.

The true hater of man expects nothing from him and is indiscriminate to his works.
-Ayn Rand
Quote:
Dude. Minus 30 credibility points.

Yep
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 6053
Location: Removed by Neddy

PostPosted: Sat Apr 15, 2017 12:11 am    Post subject: Reply with quote

Delete the sshd in init.d and just re-emerge openssh
_________________
Quote:
Removed by Chiitoo
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Sat Apr 15, 2017 12:24 am    Post subject: Reply with quote

roboto wrote:
The command you suggested did not work... the sshd file is not executable.

roboto ... no, I explictly made it executable (via chmod ... see above). I also provided the obvious, no chmod required, solution (re-merge the package). You should be able to resolve this via one of those methods.

best ... khay
Back to top
View user's profile Send private message
roboto
Apprentice
Apprentice


Joined: 15 Feb 2017
Posts: 156
Location: My IP address.

PostPosted: Sat Apr 15, 2017 12:50 am    Post subject: Reply with quote

That worked.

Thank you for your time!
_________________
Answers please.

The true hater of man expects nothing from him and is indiscriminate to his works.
-Ayn Rand
Quote:
Dude. Minus 30 credibility points.

Yep
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum