[clug-talk] Run a script on boot with Kubuntu?

Gustin Johnson gustin at echostar.ca
Sat May 20 20:57:24 PDT 2006

Hash: SHA1

Actually for simplicity sake, it is better to use /etc/fstab, rather
than the startup script.  Is the samba mount hosted on a linux or
windows server?  The following assumes that you have a linux samba
server, as Unix permissions can pass through (it is why root is mounting
the samba share).

You can modify this so that every user has their own samba share and
cannot see the samba password (/etc/fstab is world readable).

In the /etc/fstab put the following line:
//file-server/shared /shared cifs credentials=/root/.smbpasswd

The /root/.smbpassword file should like this:

It should also have 0600 as its file permission.

I got this info from the following web site, which was Debian specific
(close enough for KUbuntu):

Of course if you really want to do a startup script then put the script
(or a sym link) in /etc/init.d

then run:
update-rc.d scriptname start 25 1 2 3 4 5 . stop 25 0 1 6 .
(this assumes that your script is intelligent enough to do different
things for startup and shutdown.  Take a look at some of the /etc/init.d
scripts for ideas)

For my firewall script I ran:
update-rc.d firewall start 25 5 .
This only starts the firewall in runlevel 5, (yes I know what holes this
opens up)

for shutdown I had a separate script:
update-rc.d firewall-down stop 25 0 1 6 .

man init and man update-rc.d will be your friend here if this does not
make sense.

I was pretty sure I knew the answer, I just needed some sleep first :)

Shawn wrote:
> I have a script that mounts an SMB share to a directory in the users home 
> folder.  The user in question is not very proficient with computers, and does 
> not understand the processes happening here, but he does need access to the 
> share when the computer boots.  As well, there is one other useraccount that 
> may need access to the same share (but that's me, so I'm not toooo concerned 
> about the permissions issue at this point).
> The problem is that I can't get this script to run on boot.  With Gentoo, I 
> would just add the script to the /etc/conf.d/local.start file.  BUt with 
> Kubuntu, adding it to the /etc/rc.local file doesn't do anything.  Or to 
> the .bashrc or .bash_profile in his home directories (I know these only take 
> effect when he logs in, and possibly only when he opens a shell).  So, I'm 
> looking for the Kubuntu eqivalent to Gentoo's /etc/conf.d/local.start file.  
> any tips?
> One other note, I don't want to mess with the /etc/fstab file as I'm trying to 
> keep this box as stock as possible for simplicity - keeping in mind the 
> target user.  I also don't want to mess with the permissions on the mount 
> command.  Right now only root can mount directories, but again, the end user 
> has no clue what sudo is or how to use it (never mind trying to describe 
> opening a shell to them).
> Any tips are appreciated.
> Shawn
> _______________________________________________
> clug-talk mailing list
> clug-talk at clug.ca
> http://clug.ca/mailman/listinfo/clug-talk_clug.ca
> Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
> **Please remove these lines when replying
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the clug-talk mailing list