Koozali.org: home of the SME Server

Obsolete Releases => SME 7.x Contribs => Topic started by: mgb on July 07, 2008, 08:16:51 AM

Title: Hello I am interested to operate a file by the activation of the computer like A
Post by: mgb on July 07, 2008, 08:16:51 AM
Hello I am interested to operate a file by the activation of the computer like AOTOEXEC.BAT

In the file there is a program
 /bin/mount -t cifs //192.168.183.130/rm  /home/e-smith/files/ibays/user22rw/files/ram/rampc  -o username=domain/administrator,password=55533331

Thanks for the help
Title: Re: Hello I am interested to operate a file by the activation of the computer like A
Post by: dmay on July 07, 2008, 04:45:38 PM
The equivalent of autoexec.bat is /etc/rc.d/rc.local. However we prefer to create init scripts for most things following the Developer Manual guidelines.

Further in your specific example, auto mounting filesystems is handled via /etc/fstab. Google '/etc/fstab password' and '/etc/fstab _netdev' for further advice.

Darrell
Title: Re: Hello I am interested to operate a file by the activation of the computer like A
Post by: mgb on July 09, 2008, 06:44:32 AM
hank you to the comprehension I built a file for example

[root@mail ~]#pico monutpc
#!/bin/sh
/bin/mount -t cifs //192.168.183.130/rm  /home/e-smith/files/ibays/user22rw/files/ram/rampc  -o username=domain/administrator,password=55533331

[root@mail ~]#chmod 777 mountpc
[root@mail ~]#cp mountpc /etc/rc.d/
[root@mail ~]#pico /etc/rc.d/rc.local

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

/etc/rc.d/mountpc
or /bin/mount -t cifs //192.168.183.130/rm  /home/e-smith/files/ibays/user22rw/files/ram/rampc  -o username=domain/administrator,password=55533331
[root@mail ~]#

 In the examination check by the activation of the file is manual
is work ok is monut my pc

 I thank  on the help and hope that the English enough clear