You are not logged in.
Hi Archers ![]()
I've installed initscripts to use rc.local in Arch,
but at least below commands not successfully executed.
export VISUAL="/usr/bin/vim -p -X"
alias ll='ls -l'
complete -cf sudo
chmod 777 /dev/vmnet*
Want to know why and how to fix it ?
======================================
package check:
pacman -Q | grep initscripts
initscripts 2012.10.1-1
======================================
rc.local
#!/bin/bash
#
# /etc/rc.local: Local multi-user start-up script.
#
# set visudo to use vim as editor
export VISUAL="/usr/bin/vim -p -X"
# enable tab-completion with sudo
complete -cf sudo
# set alias
alias ll='ls -l'
# enable promiscuous mode for vmware interfaces
chmod 777 /dev/vmnet*
# show login screen on external monitor
xrandr -q | grep "VGA1 connected" > /dev/null
if [ $? -eq 0 ]; then
# xrandr --output VGA1 --mode 1440x900 --rate 60 --right-of LVDS1
xrandr --output VGA1 --mode 1440x900 --rate 60 --output LVDS1 --off
fi
# up wlan0
ip link show wlan0 | grep -i up > /dev/null
if [ $? -ne 0 ]; then
ip link set wlan0 up
fi
# connect to n13u wireless router
iw dev wlan0 scan | grep -i n13u > /dev/null
if [ $? -eq 0 ]; then
kill $(pgrep wpa_supplicant)
wpa_supplicant -Dwext -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -B
#dhclient wlan0 # for Fedora
kill $(pgrep dhcpcd)
dhcpcd wlan0
fi
======================================
Snippet from dmesg
...
[ 8.061119] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 8.171764] ppdev: user-space parallel port driver
[ 8.828551] /dev/vmnet: open called by PID 422 (vmnet-netifup)
[ 8.828558] /dev/vmnet: hub 0 does not exist, allocating memory.
[ 8.828568] /dev/vmnet: port on hub 0 successfully opened
[ 8.830003] /dev/vmnet: open called by PID 424 (vmnet-netifup)
[ 8.830008] /dev/vmnet: hub 1 does not exist, allocating memory.
[ 8.830020] /dev/vmnet: port on hub 1 successfully opened
[ 8.831297] /dev/vmnet: open called by PID 426 (vmnet-netifup)
[ 8.831301] /dev/vmnet: hub 2 does not exist, allocating memory.
[ 8.831311] /dev/vmnet: port on hub 2 successfully opened
[ 8.892082] /dev/vmnet: open called by PID 433 (vmnet-natd)
[ 8.892090] /dev/vmnet: hub 8 does not exist, allocating memory.
[ 8.892101] /dev/vmnet: port on hub 8 successfully opened
[ 8.902981] netlink: 12 bytes leftover after parsing attributes.
[ 8.902984] netlink: 12 bytes leftover after parsing attributes.
[ 8.903006] netlink: 12 bytes leftover after parsing attributes.
[ 8.903091] netlink: 12 bytes leftover after parsing attributes.
[ 8.904797] /dev/vmnet: open called by PID 434 (vmnet-netifup)
[ 8.904804] /dev/vmnet: port on hub 8 successfully opened
[ 9.087903] /dev/vmnet: open called by PID 437 (vmnet-dhcpd)
[ 9.087912] /dev/vmnet: port on hub 8 successfully opened
[ 10.607320] wlan0: authenticate with bc:ae:c5:7e:ba:fc
[ 10.627420] wlan0: send auth to bc:ae:c5:7e:ba:fc (try 1/3)
[ 10.628841] wlan0: authenticated
[ 10.640245] wlan0: associate with bc:ae:c5:7e:ba:fc (try 1/3)
[ 10.643649] wlan0: RX AssocResp from bc:ae:c5:7e:ba:fc (capab=0x431 status=0 aid=2)
[ 10.643794] wlan0: associated
[ 10.643806] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 11.135609] userif-3: sent link down event.
[ 11.135611] userif-3: sent link up event.
...
Any points would be highly appreciated.
Liao
Last edited by liao (2013-01-05 09:17:59)
Offline
export VISUAL="/usr/bin/vim -p -X"
alias ll='ls -l'
complete -cf sudo
chmod 777 /dev/vmnet*Ignoring that still using initscripts is discouraged, those commands should be executed by each session; that is, put them on your .bashrc (or .zshrc, if you use zsh)
You are doing it there because you want those commands for every single user? Fine, put them on /etc/profile instead.
oh! and learn to create unit files... really, is simple, and is the correct way ![]()
Last edited by chris_l (2012-12-14 16:02:49)
"open source is about choice"
No.
Open source is about opening the source code complying with this conditions, period. The ability to choose among several packages is just a nice side effect.
Offline
Don't use rc.local, write systemd unit files instead. Also what you have posted does not belong in rc.local at all. For shell aliases use ~/.bashrc or whatever the rc file for your shell is, for xrandr use the statup script your wm/de has, for the vmnet stuff, use a udev rule. For wifi use netcfg or networkmanager.
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
Hello,
Thanks for your comments,
I know some of the commands can be put into bashrc file,
and I'll try to study the systemd method but need sometime,
so for below single statement how can I get it run at boot? currently it's executed but failed.
chmod 777 /dev/vmnet*
Thanks,
Liao
Offline
As I said, use a udev rule instead.
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
Thanks all & Happy New Year 2013,
Just post my solution, no udev/systemd used, simply move "chmod 777 /dev/vmnet*" to the end of script, and move the export ~ alias statements to /etc/bash.bashrc, everything works well. I guess /dev/vmnet* devices would not be there before some services started, but have no idea what are the exact services.
Thanks,
Liao
Offline