LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 07-18-2016, 05:10 PM   #1
naikin
Member
 
Registered: Jun 2015
Posts: 48

Rep: Reputation: Disabled
init configuration files in slackware


I know it's a noob question but I have been really struggling to find this. I am trying to configure my graphics card and instructions suggest putting a file in
Quote:
/etc/init/bbswitch.conf
with the contents:

Quote:
description "Save power by disabling nvidia on Optimus"
author "Lekensteyn <lekensteyn@gmail.com>"
start on runlevel [2345]
stop on runlevel [016]
pre-start exec /sbin/modprobe bbswitch load_state=0 unload_state=1
pre-stop exec /sbin/rmmod bbswitch
I don't have /etc/init directory. Where will be the right place to put this configuration file. The idea is that the video card should be turned on on shutdown because the system does not like it otherwise.

PS: systemd tag is because that seems to be the equivalent on Arch according to this: https://wiki.archlinux.org/index.php...uring_shutdown
 
Old 07-18-2016, 06:13 PM   #2
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Slackware doesn't use systemd (unlike Arch). It also doesn't use upstart.

That configuration file will not work. What are you trying to do here?

Last edited by Richard Cranium; 07-18-2016 at 06:15 PM.
 
Old 07-19-2016, 12:38 AM   #3
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
Slackware uses directories /etc/rc.d and /etc/init.d which is a symlink to /etc/rc.d/init.d. Your configuration file for Bumblebee should be in /etc only.
 
1 members found this post helpful.
Old 07-19-2016, 12:47 AM   #4
aragorn2101
Member
 
Registered: Dec 2012
Location: Mauritius
Distribution: Slackware
Posts: 567

Rep: Reputation: 301Reputation: 301Reputation: 301Reputation: 301
Hi,

First, if you want to switch on or off any device, you use Slackware's init scripts found in /etc/rc.d/

If you go there you will see lots of rc scripts (e.g. rc.inet1, rc.wireless, rc.cups, ...); the ones which are executable are actually run at startup. This is how Slackware works: KISS (http://docs.slackware.com/slackwarehilosophy). With systemd you have pipelines of scripts, directories and links, where you get lost easily.

Anyway, you should give a bit more detail of what hardware you have and what you installed/tried.

From what you wrote, we understand you have an Nvidia graphics card with the Optimus technology. In that case, take a look at http://docs.slackware.com/howtos:har...nvidia_optimus

You will probably have to install some software to control the graphics, and the scripts you are looking for will come automatically.

Last edited by aragorn2101; 07-19-2016 at 12:50 AM.
 
1 members found this post helpful.
Old 07-19-2016, 04:38 PM   #5
naikin
Member
 
Registered: Jun 2015
Posts: 48

Original Poster
Rep: Reputation: Disabled
Hi, thanks for the replies. I have NVIDIA GTX 960M and I installed bumblebee following the instructions at http://docs.slackware.com/howtos:har...nvidia_optimus. What I want to do is make sure that the nvidia card is on when the system shuts down as this https://github.com/Bumblebee-Project...rd-on-shutdown suggest. My guess is that the conf file should be in placed in /etc?
 
Old 07-20-2016, 01:03 AM   #6
aragorn2101
Member
 
Registered: Dec 2012
Location: Mauritius
Distribution: Slackware
Posts: 567

Rep: Reputation: 301Reputation: 301Reputation: 301Reputation: 301
Well, there are several ways to do that. I'll tell you about 3 ways:

(1.) Slackware shutdown script /etc/rc.d/rc.6 will be run all the time when you poweroff or restart. And it will look for a /etc/rc.d/rc.local_shutdown. If you know some Bash scripting you can study how that script is called and you can place an executable rc.local_shutdown there with the code you need to stop Bumblebee.

(2.) You can place your own executable script (e.g. /etc/rc.d/rc.bumblebee_shutdown) containing the commands to do the shutdown, and then you should add a few lines in /etc/rc.d/rc.6 to call that script.

(3.) You can add the commands to stop Bumblebee in the rc.6 script itself. But this is generally not recommended because if something malfunctions it might not be obvious to trace the problem.
 
1 members found this post helpful.
Old 07-21-2016, 01:15 PM   #7
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Personally, I would only do #1. Modifying rc.6 could cause issues if Pat needs to make updates to it, because now it is modified and could be difficult to merge any changes between the old and the new.

The file /etc/rc.d/rc.local_shutdown is explicitly called in the rc.6 script so you can do exactly what you want to happen, have something happen when the computer shuts down. You can either create a script like #2 suggests, but call that script in rc.local_shutdown, or just add the command /sbin/rmmod bbswitch directly in rc.local_shutdown.

In general, unless you're semi-familiar with the boot scripts of Slackware, you should probably not edit anything in the /etc/rc.d/ folder except for rc.local and rc.local_shutdown (and any that you create). Most users have little to no need to make any changes to any of those files that they shouldn't do with rc.local or rc.local_shutdown. There are, of course, exceptions to this, but most users won't run into those types of issues.

NOTE: rc.local_shutdown does not exist by default, but if you create it and make it executable, rc.6 will execute it when the system is shutting down.
 
1 members found this post helpful.
  


Reply

Tags
init, slackware, systemd



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] init: /etc/init.conf: Configuration Directory deleted wwipro Linux - Server 2 04-30-2014 02:03 PM
What type of connection is between files in /etc/init.d and /etc/rc.d/init.d? Rodnower Linux - General 2 08-07-2010 03:32 AM
Launching KDM on slackware, and configuration files returnzero Linux - Desktop 1 06-11-2009 04:12 PM
Slackware configuration files for security baskerville Linux - Security 4 07-19-2005 02:32 PM

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

All times are GMT -5. The time now is 08:02 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