SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.