LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-14-2019, 04:15 AM   #1
ziggyzagged
LQ Newbie
 
Registered: Mar 2019
Posts: 9

Rep: Reputation: Disabled
Question service: command not found


I tried going to /sbin/service and there's no such file/directory.

How can I get the service command?
 
Old 03-14-2019, 04:36 AM   #2
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,098

Rep: Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175
there's no such command in Slackware, here bash scripts in /etc/rc.d/ are usually used to start/stop services.

read about it in the section "Startup" here.

Quote:
Originally Posted by ziggyzagged View Post
How can I get the service command?
you can't because it relies on a different init system specific of the distributions that ship that command.

Last edited by ponce; 03-14-2019 at 04:44 AM.
 
1 members found this post helpful.
Old 03-14-2019, 11:18 AM   #3
ttk
Senior Member
 
Registered: May 2012
Location: Sebastopol, CA
Distribution: Slackware64
Posts: 1,038
Blog Entries: 27

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Quote:
Originally Posted by ziggyzagged View Post
I tried going to /sbin/service and there's no such file/directory.

How can I get the service command?
If you explain the task you are trying to accomplish with the "service" command, we might be able to explain how to do it in Slackware (which uses the traditional init system).
 
Old 03-14-2019, 11:27 AM   #4
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
ziggyzagged --

What ponce said ...

and what ttk said ...

Slackware has a VERY NICE and CLEAN system for starting daemons ( services ).

Service is a RedHat thing and it's been deprecated in RHEL7 ... they want you to use systemd version of the service commands now ...

Just another $0.02 ...

EDIT: Just noticed there is no obvious pointer to the /etc/rc.d/ Directory in ponce's link.

The Slackware equivalent of RHEL services will be found in the /etc/rc.d directory as a set of executable shell scripts.

For example:
Code:
   RHEL:      # service smb start
   Slackware: # /etc/rc.d/rc.samba start         # make sure that the permissions are 755 first !
If you have an Idea which service you want to start, the filenames in /etc/rc.d/ are pretty clear ( example: rc.samba )

Do be sure to set permissions to 755 for any daemon ( service ) you want to start automatically at boot ( after any configuration )

Check the Docs on ponce's link for more info. There are 'a zillion' docs over there !

HTH.

-- kjh

Last edited by kjhambrick; 03-14-2019 at 11:41 AM. Reason: just noticed ...
 
Old 03-14-2019, 01:35 PM   #5
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Rep: Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161
If you want a service command, here is something I created about 15 years ago. Throw the script into /usr/local/sbin.

Code:
#!/bin/bash
# /usr/local/sbin/service

# A script to start/stop/restart system scripts without typing the full path.

RCD_PATH="/etc/rc.d"

SERVICE="$1"
ACTION="$2"

if [ -z "$SERVICE" ] || [ "$1" = "-h" ] || [ "$1" = "-help" ] || [ "$1" = "--help" ]; then
  echo "Correct usage: $0 script-name [action]"
  exit 0
fi
SERVICE="`echo $SERVICE | sed 's/^rc.//'`"
if [ ! -f "$RCD_PATH/rc.$SERVICE" ]; then
  echo "$RCD_PATH/rc.$SERVICE does not exist."
  exit 0
else
  bash $RCD_PATH/rc.$SERVICE $ACTION
fi
Massage or murder the script as you see fit.
 
2 members found this post helpful.
Old 03-15-2019, 12:29 AM   #6
ziggyzagged
LQ Newbie
 
Registered: Mar 2019
Posts: 9

Original Poster
Rep: Reputation: Disabled
I want to perform this action:
Code:
service auditd reload
 
Old 03-15-2019, 01:03 AM   #7
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,098

Rep: Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175
Quote:
Originally Posted by ziggyzagged View Post
I want to perform this action:
Code:
service auditd reload
Slackware does not ship the audit package, but it's available on SlackBuilds.org: if you install it from there

https://slackbuilds.org/howto/
https://slackbuilds.org/repository/14.2/system/audit/

then you will have an /etc/rc.d/rc.auditd script with which you could eventually do
Code:
/etc/rc.d/rc.auditd reload
just be sure to read the README and README.SLACKWARE files.

Last edited by ponce; 03-15-2019 at 02:30 AM.
 
3 members found this post helpful.
  


Reply

Tags
command, found, service, slackware



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] No package 'x11' found No package 'xext' found No package 'xdamage' found No package 'xfixes' found No package 'x11-xcb' found Jigsaw Linux From Scratch 14 02-23-2021 08:35 PM
"Command not found" on my server? “bash: sudo: command not found”? MilesOfRoses Linux - Server 7 04-01-2016 09:19 AM
[SOLVED] complete noob question. "command not found" "command not found" jeanlucpicard Linux - Newbie 4 08-27-2013 02:14 AM
Directory not found; -xzvf not found; Makefile not found RealGomer Linux - Software 4 09-20-2010 10:02 AM
bash: rpm: command not found && sudo: alien: command not found Java_Code Ubuntu 7 07-27-2006 11:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:52 PM.

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