Wicd works, network startup scripts don't
Title tells the story. Using wicd-1.7 I can connect to wireless networks and the connection remains stable. Using various combinations of rc.conf settings, netcfg, /etc/conf.d/wireless getting a connection is impossible at boot time and problematic after boot. The problem occurs on every system I've tested arch on. Wicd works, network startup scripts don't or only occasionally if some magic spell is properly cast. I'm positive I've configured the settings in rc.conf correctly as I've been able to connect using those by some combination of rmmod WLAN_MODULE, modprobe WLAN_MODULE, /etc/rc.d/network restart or netcfg ESSID. The requirement is that I am willing to go through the sequence multiple times.
I have just started testing arch and don't know if the network scripts worked before, but I assume they must have. Were there changes in the network startup scripts recently? I'm seeing many topics in the forums related to wireless problems.
When I say that netcfg ESSID works after startup, I mean that it works sometimes and that net-auto-wireless failed along with all other options that had the wireless start during boot. I'm not sure which version I tried but this was a new install in December or January and I was ready to remove arch by the end of February. A new version of wicd was released with some bug fixes that kept arch on the systems. Had that failed this laptop would likely have a BSD on it. Probably OpenBSD as I haven't tested that yet.
My current settings are configured for wicd and not causing any significant issues, other than having to reload the wireless driver when resuming from suspend.
Similar Messages
-
Dhcpcd not starting correctly via rc.d/network startup script
Whenever I try to setup my network with /etc/rc.d/network I always fail to get a lease. When I execute the same command manually, I get an IP and everything associated with it.
I've added the lines below to the network script for debugging:
echo 'whoami: '`whoami`
echo 'which dhcpcd: '`which dhcpcd`
echo '$DHCPCD_ARGS: '$DHCPCD_ARGS
echo '$interface: '$interface
I've set it to debug mode, and have the output when running it below
[foo@bar etc]$ sudo rc.d/network start
:: Starting network [BUSY]
whoami: root
which dhcpcd: /usr/sbin/dhcpcd
$DHCPCD_ARGS: -d
$interface: eth0
dhcpcd[3483]: version 5.5.6 starting
dhcpcd[3483]: eth0: using hwaddr 52:44:a3:6c:c2:72
dhcpcd[3483]: eth0: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks', reason PREINIT
dhcpcd[3483]: eth0: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks', reason NOCARRIER
dhcpcd[3483]: eth0: carrier acquired
dhcpcd[3483]: eth0: using hwaddr 52:44:a3:6c:c2:72
dhcpcd[3483]: eth0: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks', reason CARRIER
dhcpcd[3483]: eth0: carrier lost
dhcpcd[3483]: eth0: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks', reason NOCARRIER
dhcpcd[3483]: eth0: waiting for carrier
dhcpcd[3483]: eth0: carrier acquired
dhcpcd[3483]: eth0: using hwaddr 52:44:a3:6c:c2:72
dhcpcd[3483]: eth0: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks', reason CARRIER
dhcpcd[3483]: eth0: broadcasting for a lease
dhcpcd[3483]: eth0: sending DISCOVER (xid 0xc83b6419), next in 4.84 seconds
dhcpcd[3483]: eth0: sending DISCOVER (xid 0xc83b6419), next in 8.24 seconds
dhcpcd[3483]: eth0: sending DISCOVER (xid 0xc83b6419), next in 16.37 seconds
dhcpcd[3483]: timed out
Yet I run the same command manually and everything's happy:
[spitfire@killdesk etc]$ sudo /usr/sbin/dhcpcd -d eth0
dhcpcd[3511]: version 5.5.6 starting
dhcpcd[3511]: eth0: using hwaddr 52:44:a3:6c:c2:72
dhcpcd[3511]: eth0: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks', reason PREINIT
dhcpcd[3511]: eth0: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks', reason CARRIER
dhcpcd[3511]: eth0: broadcasting for a lease
dhcpcd[3511]: eth0: sending DISCOVER (xid 0xfddd3649), next in 4.66 seconds
dhcpcd[3511]: eth0: offered 192.168.1.1 from 192.168.1.254
dhcpcd[3511]: eth0: sending REQUEST (xid 0xfddd3649), next in 3.31 seconds
dhcpcd[3511]: eth0: acknowledged 192.168.1.1 from 192.168.1.254
dhcpcd[3511]: eth0: checking for 192.168.1.254
dhcpcd[3511]: eth0: sending ARP probe (1 of 3), next in 1.94 seconds
dhcpcd[3511]: eth0: sending ARP probe (2 of 3), next in 1.40 seconds
dhcpcd[3511]: eth0: sending ARP probe (3 of 3), next in 2.00 seconds
dhcpcd[3511]: eth0: leased 192.168.1.1 for infinity
dhcpcd[3511]: eth0: adding IP address 192.168.1.1/24
dhcpcd[3511]: eth0: adding route to 192.168.216.0/24
dhcpcd[3511]: eth0: adding default route via 192.168.1.254
dhcpcd[3511]: eth0: writing lease `/var/lib/dhcpcd/dhcpcd-eth0.lease'
dhcpcd[3511]: eth0: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks', reason BOUND
dhcpcd[3511]: forking to background
dhcpcd[3511]: forked to background, child pid 3537
What am I doing wrong, and/or what can I do to fix this?Maybe I got something wrong here but didn't sspitfire write that dhcpcd only works when starting it manually after it failed at startup? What exactly is "noip4all" supposed to do, I'm asking because it didn't work for me. I tried "noip4ll" like written in dhcpcds manpage without any effort . "noarp" and "waitip" also had no positive effect. Maybe I leave dhcpcd in the rc.local even if it's a bit of a dirty solution. ("noarp" and "waitip" I gathered from the dhcpcd manpage).
-
I can't get Photoshop CS6 startup script to works ?
Hi!
I'm trying to get a script to execute each time photoshop cs6 is started. I've tried to put it in that folder ( Photoshop-CS6-Scripting-Guide.pdf page 10) C:\Program Files\Common Files\Adobe\Startup Scripts CS6\Adobe Photoshop but it doesn't start ... If I put it in there C:\Users\[USERNAME]\AppData\Roaming\Adobe\Bridge CS6\Startup Scripts it loads when I start BridgeCS6 but it fails as it's a script done for photoshop. So I try to put it in C:\Users\[USERNAME]\AppData\Roaming\Adobe\Photoshop CS6\Startup Scripts but didn't work as I was expecting ;o) .
I don' think it matters but my OS is in french but photoshop is in english.
So where is the proper place ?
cheersYes Startup Scripts is a Bridge thing. If you open Bridge and use menu Edit>Preferences you will see Startup Scripts in the left pane if highlight that the right pane will contain a check box list of startup scripts you can enable.
Photoshop has a script event manager. Script and action can be start automatically when an event occurs. They will not start if a a started event process has not finished nesting will not happen. So on an event like start application, new document, open document a script or action can be set to run.
I never tried setting one up for start application but Photoshop ships with one named clean listener which could be useful. Find it in:
presete\scripys\Event Scripts Only. And menu>File>Scripts>Scripts Event Manager -
Dont work startup script after update windows7 of wsus
hi
i have a domain controller 2008
my clients is windows7 ultimate
i have a file .exe and i create a policy and this file .exe in start up script
this policy is correct
but when update clients. this policy not work .and in task manager, this file .exe with username system show
what happend
please help mehi
i test a way,
i install a windows 7
then in gpedit.msc, in startup script, add this file, when restart windows , this policy ok
now ,i update this windows7, and about get 160 update of microsoft, now when restart windows, this policy not work and in task manager, this file .exe with username system show
this error not happend to my domain
please help me -
Although I'm connected to my Wi-Fi network my computer keeps "looking for new networks." How can I stop it from doing so when I'm working at home and don't want another network?
You might want to update Safari to 3.12. I would empty the safari cache. (Safari>Empty Cache). Then quit Safari. System Preferences>Network>Show:Airport>TCP/IP. Insert the following into the DNS Servers box;
208.67.222.222
208.67.220.220
then hit apply. Now launch Safari. You should also try powering down modem, router and Mac and power up in 2 minute sequence; modem, router, Mac. -
Systemd startup script - half of the commands run, half don't??
i have a previous rc.local file which was a startup script on a router machine i have. it is designed to run tcpdump commands for the interfaces and output them to terminals tty9, tty10, and tty11. it worked perfectly...
i have since transitioned to systemd. I followed wiki instructions to make a oneshot service file and have enabled it. here is the file: (/usr/lib/systemd/system/startup.service)
[Unit]
Description=Startup Script
After=iptables.service
[Service]
Type=oneshot
ExecStart=/etc/scripts/startup
[Install]
WantedBy=multi-user.target
here is the script /etc/scripts/startup: (email addresses disquised)
#!/bin/bash
route add -net 10.11.12.0/24 gw 172.16.16.4
/usr/sbin/tcpdump -pnq -i external >> /dev/tty11 &
/usr/sbin/tcpdump -pnq -i internal >> /dev/tty10 &
/usr/sbin/tcpdump -pq -i wifi >> /dev/tty9 &
echo "$HOSTNAME system startup complete `date '+%r %x'`" | /usr/bin/mailx -c "[email protected]" -s "$HOSTNAME Startup Message" [email protected]
here is the output from the startup command with journalctl:
Nov 18 22:46:10 pLAN9-Gateway systemd[1]: Starting Startup Script...
Nov 18 22:46:10 pLAN9-Gateway systemd[1]: Starting OpenSSH Daemon...
Nov 18 22:46:10 pLAN9-Gateway systemd[1]: Started OpenSSH Daemon.
Nov 18 22:46:13 pLAN9-Gateway startup[409]: . . . message not sent.
Nov 18 22:46:13 pLAN9-Gateway systemd[1]: Started Startup Script.
the route add command runs, but nothing else does. as you can see, there is absolutley NOTHING helpful in the log, other than the completely useless "message not sent" output from mailx. running the startup script manually with "systemctl start startup" works fine.
iptables.service is setup to run After=netcfg.service, so I would assume that beucase the startup script runs after iptables, it should run after netcfg as well.
why aren't these commands running?A oneshot service is killed once the main process returns (that's why it is called a "oneshot"). Your tcpdump processes are killed once startup returns.
-
GPO with a startup script is not working.
I have a GPO that I have added a ".bat" script to the "Computer Configuration\Windows Settings\scripts\startup/shutdown" section. The batch file is located in the netlogon folder. This script was part of another Old GPO
that I want to consolidate into this new GPO. So I am taking the exact settings from the old GPO and applying it to the new GPO.
The script does not run at startup and when I go into Group Policy Management, highlight the GPO then on the right pane click the settings tab it doesn't display the startup script as being set. It's just not there. If I select edit and go to the
"Computer Configuration\Windows Settings\scripts\startup/shutdown\startup" section the .bat script is present though.
Also if I do a gpresult it also shows that it isn't running the script but all other settings in the GPO are being applied.
This GPO has the User Config. side disabled
Why isn't the GPO applying the script or even acknowledging that it is present in the settings tab?Hi,
I could not see any report in the above link. I would like to know that did you follow the below path:
http://technet.microsoft.com/en-us/magazine/dd630947.aspx
In addition, logon script could only be applied to users. If want to apply to computers, we should use startup script.
Regards,
Yan Li
If you have any feedback on our support, please click
here
Cataleya Li
TechNet Community Support -
[Solved][Awesome]Keyboard don't work at startup
Hello.
I have the problem with awesome wm. I'm using git build 20120516-1 with default rc.lua.
The problem is, when awesome is started, keyboard (modkey + r) is not working. I must click with mouse on the menu, open terminal, or some app from menu, and then keys start working.
Anyone have an idea why this is happening?
Thanks.
EDIT: Changed login manager to slim, and all is working fine.
Last edited by Zmuss (2012-05-17 20:56:52)Well, the 'unplugged' reference was noted earlier and I wasn't sure if you'd get a
better response than a standard suggestion to try the other ideas in this link first
•Intel-based Macs: Resetting the System Management Controller (SMC) - Apple Support
before actually performing the SMC, that is a dragnet kind of catch-all, sometimes.
All of my keyboard & mouse units are USB and I've gone as far as supplying the
mouse and other peripherals with a powered USB hub; so power from the Mac
isn't spread too thin. The keyboard is one of the only items that should be attached
to the USB port; as it has to work on startup pre-boot keyboard shortcuts... Such
as SafeBoot, PRAM reset, and others where you need a live keyboard and BT
may not be up to the task of being ready. Three going on four of my Macs have
bluetooth capabilities for those items; but I can't justify the continual upkeep cost.
Spare USB keyboards and a few extra mouse are handy as troubleshooting tools, too.
There are some USB keyboard references among search results in this linked page:
https://www.google.com/?gws_rd=ssl#q=Apple+USB+keyboard+troubleshooting
Perhaps the SMC pre-reset suggestions may help resolve the issue, if not, try reset.
Good luck & happy computing!
edited -
Group Policy - Computer Startup Scripts - Add/Set Default printer
Good Morning.
Let's say we have 2 offices, A and B, and only 1 user. The user is using Roaming Profiles. Each office has its own printer.
What I am trying to do, is make a Startup script that is specific to the COMPUTER being logged into so when any user logs into that computer, they get the printer in that office defined and set as default.
I am able to do this successfully with my script but ONLY if i have the script be on the USER side of GP (i.e. in the Logon script section)
That is great that that is working however, when my user goes to Office B, they still get mapped to Office A's printer if I use that method.
So I figured I could just modify my GP and run the same script from the STARTUP section of the computer, rather than the LOGON section of the user. It does not work.
Here is my script:
Set WRFCUNetwork = CreateObject("Wscript.Network")
PrinterPath = "\\fileserver\MAINTELLER"
PrinterDriver = "PrinterDriver"
WRFCUNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver
WRFCUNetwork.SetDefaultPrinter "\\fileserver\MAINTELLER"
This is where I Have the script placed:
Computer Configuration -> Windows Settings -> Scripts(Startup/Shutdown)
Once i'm in there, I double click Startup, click Add, and select my script which is named:
MainPrinterSetup.vbs
I have this GP applied to ONE OU, and that OU has ONE computer in it (my test computer)
I login with a brand new user called "testuser" (creative, huh?) and basically nothing happens
except they log in and have some Microsoft Document Image Writer printer set as default (which by the way sure does slow the PC down to the point of it almost being broke if anyone actually tries to print to that by accident)
No Main Teller Printer, no anything.
The strangest part about this is, if i apply this script to the user LOGON scripts, it works fine, the printer is there, and is set as default. (but see above why that wont work for my situation)
So obviously the script works fine, but I guess i'm missing something when it comes to applying GP's to Computers rather than Users.
Can anyone shed some light as to why the script is not running (i'm guessing the script isn't even attempting to run, rather than failing, but i have no way to know that)
Thank you in advance!!
Derek Conlon
Network Administrator
WRFCU
EDIT: Here are the PC's info that i'm working on:
Server: Windows Server 2003 Standard Edition (where my GP's are created and managed with AD)
Target PC: Windows XP Professional SP3
EDIT #2: I manually navigated to the Script file after logging in and "opened" it and it added and set the default printer no problem. the issue is definately with the script running at startup.I wanted to clarify a few things:
1. While it is true that printer connections are usually per user, it is definitely possible to create "global printers". There are a number of ways to do this, but two methods that come to mind are using:
a. "Rundll32 printui.dll,PrintUIEntry" option with the "/ga" switch. The "/ga" switch is the key here since it allows you to deploy printers "per machine" instead of "per user". More information
about this is available at:
http://members.shaw.ca/bsanders/NetPrinterAllUsers.htm
http://technet.microsoft.com/en-us/library/ee624057%28WS.10%29.aspx
http://www.computerperformance.co.uk/Logon/logon_printer_computer.htm
http://www.robvanderwoude.com/2kprintcontrol.php
b. The Print Management console that is available in Windows 2003 R2 and higher can help you deploy printers "per machine" in addition to "per user". More information about this is available at:
http://www.czsolution.com/print-management/print-management/print-management-console.htm#DeployingPrintersByGroupPolicy
http://technet.microsoft.com/en-us/library/cc753109%28WS.10%29.aspx
2. As Guy mentioned, Group Policy Preferences can help set the default printer. But there is another way to accomplish this. The problem with the computer startup portion is that it runs before the user logs in. And applying this script
in the login script section would not work per computer unless you used loopback processing. So another way to do this is to place a script that sets the default printer into the "All Users" startup folder. Items in the "All Users"
startup folder run for any user that logs into the computer, but it runs in the user's context. So, this script would effectively set the default printer on a "per machine" basis. The script method is a cruder way to approach the problem,
but it will help get the job done. Here are some resources on setting the default printer via script:
http://www.intelliadmin.com/index.php/2007/08/set-default-printer-from-a-script
http://www.computerperformance.co.uk/ezine/ezine17.htm -
Group Policy Startup Script Applies My Policy But Does Not Run The Acual Scripts
I have created a basic batch file with msiexec.exe to uninstall a program on startup and then another separate .bat script to install the same program but the newer version. The software I'm referring to has to be completely uninstalled BEFORE
I install the "newer" version of the same program, it cannot just be overwritten. If I run a gpupdate /force on the client computer and restart, the scripts run as they are supposed to and everything works but the problem is that I can't get it to
run on first boot on a computer that has been turned off for months, even after multiple reboots it still doesn't run the scripts. The 3 policies apply to the different computers/users but the scripts don't run. I manage a theme park that is
only open 4 months of the year so the rest of the time the in park PC's are turned off. I have created my OU as "POS Computers & Users" which has all of the computers and users that will take this policy. I also have 3 Group Policy
Objects attached to this OU in Group Policy, 1 is the program uninstallation .bat script policy that runs on startup, 2 is the install .bat script policy that runs after the uninstallation script, and 3 is the Default Policy for the OU. I already have the
"Always wait for the network at computer startup and logon", "Run startup scripts visible"enabled, "Run startup scripts asynchronously" disabled, and "Run Logon Scripts Synchronously" enabled for all 3 of the
policies. They are all "link enabled" and security filtering is set to only the OU I mentioned earlier so that it doesn't affect anyone else. I have the link order set as the script I want to run first as the last and the one I want to run last first
because from what I understand inheritance is from bottom to top. The install file is accessible by everyone with full permissions on our "Shared" drive so I know its not a permissions issue because it runs after a gpupdate /force with a restart.
The scripts are in the proper folder for the policies they are attached to and permissions are fine.
Here is my uninstall .bat script (msiexec.exe /X{14324A6A-BDD1-4F40-8E77-664C8AEEA251} /forcerestart /qb-! ALLUSERS=1 REMOVE=ALL)
Here is my install .bat script (msiexec.exe /i {\\kksrvad\shared\Gatemaster\NewGatemaster.msi} /qb ALLUSERS=1)Can't be done in a login script.
This is a Group Policy issue and not a scripting issue. You do not have a script. You have a command saved in a batch file and you are using a GPO. Not a scripting issue.
¯\_(ツ)_/¯ -
At home I have my laptop with arch linux connected to my computer downstairs and the network is configured using dhcp. When I take my laptop with me to work it is not connected however and it sits there trying to connect to a computer that isn't there because it is not hooked up to anything. After a while it decides the network is down and gives me a login prompt.
Is there a way to reduce the time it waits before it gives me a prompt?
I have looked in the /etc/rc.d/network script but that doesn't make a whole lot of sense to me.
Anyone have any ideas on this? (perhaps reducing the time it waits is a bad idea...I dunno)
Thanks!
HC... adding a "-t 12" to the ifup() /etc/rc.d/network was the first thing i changed after installing arch on my laptop and booting offline the first time waiting 1min ... it is a nice workaround (you have to use on some distros with simmilar startup-scripts) but it leads to some not nice things:
-> if you connect again to a LAN, you have to start the network manually (# /etc/rc.d/network start)
-> in shutdown-sequence, it will complain about network not running
=> it works, of course, but as i'm a semi-perfectionist, i was thinking about another way to solve the 1min-waiting:
i wanted to actually background "dhcpcd" imediately after start, so that the bootprocess can go on and the "dhcpcd" waits in the background for an answer the whole 60s
(at the UNI, we have a really slow dhcp-server, that if i had the -t to less than 28 i dont get an ip :-( but on the other side, i dont want to wait 29s to know that there is no LAN connected to my laptop)
unfortunately the dhcpcd has no option to go to background
-> anybody to know how to say the dhcpcd to go to background (without rewriting the whole startup-scripts!)?
then i got an idea about another way to handle this: what about changing the /etc/rc.multi to offer to press a key (e.g. "n" == "This Daemon? [N]o thanx!") while a daemon is starting to stop the starting of this daemon
the advantage of a such solution: you dont need to set an timeout-value which may hinder you to connect to a LAN that responds slowly or have to wait for nothing
:::: the problem is: i have no idea how you can do this () --- gurus, please help ... the part that has to be changed looks now like this:
# Start daemons
for daemon in "${DAEMONS[@]}"; do
if [[ `echo $daemon | grep '^[^!]' | wc -l` -eq 1 ]]; then
/etc/rc.d/$daemon start
fi
done
-> shortly said: i want to be able to kill "/etc/rc.d/$daemon start" while it is running by pressing only one key on my keyboard -
Dear All
Can I have a IBM AIX DB Startup Scripts ?
Regards
Lakmalput
Orastart:2:wait:/usr/local/bin/changedbstatus_ora start all FORCE> /dev/console 2>&1
at the end of /etc/inittab
and
/usr/local/bin/changedbstatus_ora stop all FORCE
in /etc/rc.shutdown
where changedbstatus is similar to the following
[haiti]/db_masters $ cat changedbstatus_ora
#!/bin/sh
# usage: changedbstatus_ora start|stop
# This script is used to start or stop ORACLE
# $1 = Start, Stop, or reset_logs
# $2 = SID to start or stop (can be all)
# $3 = FORCE Force a shutdown or startup
# if $2 is not specified it defaults to all. this allows autostart/stop during
# system startup/shutdown
# Written by Graham Myers, Coda plc, (c) 2001
# fn_determine_version
# returns VERSION (7.3.4, 8.1.7, 9.2.0 etc)
fn_determine_version() {
set +x
if [ -f ${ORACLE_HOME}/bin/sqldba ]
then
VERSION=`sqldba command=exit | \
awk '/SQL\*DBA: (Release|Version)/ {split($3, V, ".") ; print V[1]}'`
elif [ -f ${ORACLE_HOME}/bin/svrmgrl ]
then
VERSION=`$ORACLE_HOME/bin/svrmgrl command=exit | awk '
/PL\/SQL (Release|Version)/ { print substr($3,1,5); exit }
/Oracle7 Server (Release|Version)/ { print substr($4,1,5); exit }
/Oracle8i Enterprise Edition (Release|Version)/ { print substr($5,1,5); exit }
/Oracle8i (Release|Version)/ { print substr($3,1,5); exit }'`
else
VERSION=`$ORACLE_HOME/bin/sqlplus -? | awk '/SQL\*Plus: Release/ {print substr($3,1,5); exit }'`
fi
VERSION_MAJOR=`echo ${VERSION} | cut -d. -f1`
# fn_determine_os - determine whioh operating system we're using, returns:
# BITS - no of processor bits 32 or 64
# ORATAB - set to correct path of oratab file
fn_determine_os() {
set +x
ORATAB=/etc/oratab
case `uname` in
SunOS)
BITS=`isainfo -kv | cut -d"-" -f 1`
ORATAB=/var/opt/oracle/oratab;;
HP-UX)
BITS=`/bin/getconf KERNEL_BITS`;;
AIX)
BITS=`/usr/sbin/bootinfo -K`;;
OSF1)
BITS=64;;
esac
# fn_check_status - check instance status
# Returns STATUS (1=running, 0=not running)
fn_check_status() {
set +x
#Check to see if instance shutdown cleanly (or is still running)
STATUS=0
if [ ${VERSION_MAJOR} -ge 8 ]
then
[ "`ps -ef | egrep pmon_${ORACLE_SID} | grep -v grep`" != "" ] && STATUS=1
else
[ -f ${ORACLE_HOME}/dbs/sgadef${ORACLE_SID}.dbf -o \
-f ${ORACLE_HOME}/dbs/sgadef${ORACLE_SID}.ora ] && STATUS=1
fi
# fn_cmd_file - Create a UNIX command script
# inputs $1 command - begin create a new command file
# begin_agent start an angent comamnd file
# command actual comamnds to place in command file
# start_sql run up the relevent SQL processor
# stop_sql exit out of SQL processor
# end finish off command file
fn_cmd_file() {
set +x
case $1 in
begin | begin_agent)
CMD_FILE=/tmp/changedbstatus.tmp$$
RDBMS_HOME=`grep oracle /etc/passwd | awk -F: '{print $6}'`
# Make sure the correct verion of Oracle is defined at login
if [ "$1" = "begin" ]
then
echo "Oracle_${VERSION}(${ORACLE_SID})" > ${RDBMS_HOME}/.rdbms_defaults
else
echo "Oracle_10.1.0(agent)" > ${RDBMS_HOME}/.rdbms_defaults
fi
echo "unset TWO_TASK" >> ${CMD_FILE};;
start_sql)
case "${VERSION}" in
"7") SQL_COMMAND="sqldba";;
"7.3.4"|"8.0.5") SQL_COMMAND="svrmgrl";;
*) SQL_COMMAND="sqlplus /nolog";;
esac
echo "${SQL_COMMAND}<<EOF" >> ${CMD_FILE}
echo "connect / as sysdba" >> ${CMD_FILE};;
command)
shift
echo "$*" >> ${CMD_FILE};;
end_sql)
echo "EOF" >> ${CMD_FILE};;
end)
chmod 755 ${CMD_FILE};;
esac
# fn_execute_cmd_file
# PLEASE NOTE the strange way of eching the session to the display rather than
# using tee. For some reason agentctl does not "let go" of the session and
# tee hangs. This is a documented "non-bug" for tnslsnr on 8i but nobody has
# has reported it for agentctl for 9i
# $1 should be a message to write to the screen prior to execution so the user
# has an indication something is happening
fn_execute_cmd_file() {
set +x
echo $1
su - oracle -c ${CMD_FILE} > ${CMD_FILE}.log 2>&1
RETURN_STATUS=$?
cat ${CMD_FILE}.log
# Scrap the defaults file after the command script has run
rm ${RDBMS_HOME}/.rdbms_defaults ${CMD_FILE}
# fn_reset_logs - rename existing log, create a new one, and purge old ones
# if $1 is non blank then it is assumed to be embedded in another command
# and so will not start a new command file (or execute it)
fn_reset_logs() {
set +x
if [ "$1" = "" ]
then
fn_cmd_file begin
fn_cmd_file command set +x
fi
if [ ${VERSION_MAJOR} -ge 9 ]
then
fn_cmd_file command "dmp_dest=\`grep background_dump_dest $PFILE|awk -F\"'\" '{print \$2}'\`"
else
fn_cmd_file command "dmp_dest=\`grep background_dump_dest $PFILE|awk '{print \$3}'\`"
fi
fn_cmd_file command "cd \${dmp_dest}"
fn_cmd_file command "dmp=alert_\${ORACLE_SID}.log"
fn_cmd_file command "new_dmp=\${dmp}.\`date +%y%m%d\`"
fn_cmd_file command "if [ -f \${new_dmp}.Z ]"
fn_cmd_file command "then"
fn_cmd_file command " zcat \${dmp} >> \${new_dmp}"
fn_cmd_file command " rm \${dmp} \${new_dmp}.Z"
fn_cmd_file command "else"
fn_cmd_file command " mv \${dmp} \${new_dmp}"
fn_cmd_file command "fi"
fn_cmd_file command "compress \${new_dmp}"
fn_cmd_file command "find ./ -name "\${dmp}.*" -mtime +30 -print -exec rm {} \\\+"
fn_cmd_file command "find ./ -name "/tmp/changdbstatus*" -mtime +2 -print -exec rm {} \\\+"
if [ "$1" = "" ]
then
fn_cmd_file end
fn_execute_cmd_file "reseting log files..."
fi
# fn_start_agent - Start the 10g intelligent agent
# This is only done once and only if a 64-bit server
fn_start_agent() {
set +x
fn_cmd_file begin_agent
fn_cmd_file command emctl start agent
fn_cmd_file end
fn_execute_cmd_file "Starting Intelligent Agent..."
# fn_stop_agent - Stop the 9i intelligent agent
# This is only done once and only if 64-bit server
fn_stop_agent() {
set +x
fn_cmd_file begin_agent
fn_cmd_file command emctl stop agent
fn_cmd_file end
fn_execute_cmd_file "Stopping Intelligent Agent..."
# fn_start_database - Start database
fn_start_database() {
set +x
fn_cmd_file begin
fn_cmd_file command set +x
fn_reset_logs include
fn_determine_listener
[ "`ps -ef | egrep ${LISTENER_NAME} | grep -v grep`" = "" ] && fn_cmd_file command lsnrctl start ${LISTENER_NAME}
fn_cmd_file start_sql
fn_cmd_file command startup
fn_cmd_file end_sql
#We now use an Oracle 10g Enterprise manager which does not support Oracle 8i agents so don't start them
# if [ ${VERSION_MAJOR} -lt 9 ]
# then
# # start the intelligent agent and data gatherer
# fn_cmd_file command vppcntl -start
# fn_cmd_file command lsnrctl dbsnmp_start
# fi
fn_cmd_file end
fn_execute_cmd_file "Starting instance ${ORACLE_SID}..."
# fn_stop_database - Stop database $1 passed as abort if required
fn_stop_database() {
set +x
fn_cmd_file begin
if [ "${ALL_DATABASES}" = "Y" ]
then
#We now use an Oracle 10g Enterprise manager which does not support Oracle 8i agents so they haven't been started
# if [ ${VERSION_MAJOR} -lt 9 ]
# then
# # stop the data gatherer and agent
# fn_cmd_file command vppcntl -stop
# fn_cmd_file command lsnrctl dbsnmp_stop
# fi
fn_determine_listener
[ "`ps -ef | egrep ${LISTENER_NAME} | grep -v grep`" != "" ] && fn_cmd_file command lsnrctl stop ${LISTENER_NAME}
fi
fn_cmd_file start_sql
fn_cmd_file command shutdown $1
fn_cmd_file end_sql
fn_cmd_file end
fn_execute_cmd_file "Stopping instance ${ORACLE_SID}..."
# fn_determine_listener - work out listener name
# For 8i it will be listener_817
# For 9i it will be listener_<hostname> as we use MTS
# on 9i and only need the listener for OEM.
fn_determine_listener() {
set +x
LISTENER_NAME=`grep "SID_LIST_" ${TNS_ADMIN:-$ORACLE_HOME/network/admin}/listener.ora | \
cut -d "_" -f 3- | cut -d "=" -f 1`
(trap 'exit' 1 2 3
set +x
fn_determine_os
ORIGINAL_ORACLE_HOME=${ORACLE_HOME}
ORIGINAL_ORACLE_PATH=${ORACLE_PATH}
ORIGINAL_LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
ORIGINAL_PATH=${PATH}
if [ "$3" = "FORCE" ]
then
FORCE=Y
else
FORCE=N
fi
if [ "$2" = "all" -o "$2" = "" ]
then
FILTER="tee /dev/null"
ALL_DATABASES=Y
#if $2 is null then we are in system startup/shutdown - so force db start/stop
# this will get around any rogue files maybe due to a previous crash
[ "$2" = "" ] && FORCE=Y
#if we are starting all databases then assume we are starting everthing fresh
# so start the intelligent agent
if [ \( "$1" = "start" -o "$1" = "START" \) -a "${BITS}" = "64" ]
then
fn_start_agent
fi
else
FILTER="grep ^$2:" #Only apply filter if not all
ALL_DATABASES=N
fi
grep -v "^#" ${ORATAB} | ${FILTER} | awk -F: '{print $1,$2,$3}' | \
while read ORATAB_SID ORATAB_HOME ORATAB_START
do
ORACLE_SID=${ORATAB_SID} ;export ORACLE_SID
ORACLE_HOME=${ORATAB_HOME} ;export ORACLE_HOME
PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/etc ;export PATH
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${ORACLE_HOME}/lib ;export LD_LIBRARY_PATH
fn_determine_version #Work out which version of Oracle is required
if [ ${VERSION_MAJOR} -ge 9 ]
then
PFILE=${ORACLE_HOME}/dbs/spfile${ORACLE_SID}.ora
else
PFILE=${ORACLE_HOME}/dbs/init${ORACLE_SID}.ora
fi
if [ -f ${PFILE} ]
then
fn_check_status #See if instance is already running
case $1 in
start | START )
if [ ${STATUS} -eq 1 ]
then
if [ "${FORCE}" = "Y" ]
then
echo Instance ${ORACLE_SID} already running - forcing shutdown
fn_stop_database abort
else
echo Instance ${ORACLE_SID} already running
continue
fi
fi
if [ "${ALL_DATABASES}" = "Y" -o \( "${ORATAB_START}" = "Y" -a "${ALL_DATABASES}" = "N" \) ]
then
fn_start_database
if [ ${RETURN_STATUS} -eq 0 ]
then
echo "Instance ${ORACLE_SID} started."
else
echo "Instance ${ORACLE_SID} NOT started."
fi
else
echo "Instance ${ORACLE_SID} NOT started."
fi;;
stop | STOP)
if [ ${STATUS} -eq 0 ]
then
if [ "${FORCE}" = "Y" ]
then
echo Instance ${ORACLE_SID} already shutdown - forcing shutdown
fn_stop_database abort
else
echo Instance ${ORACLE_SID} already shutdown
continue
fi
else
fn_stop_database IMMEDIATE
if [ ${RETURN_STATUS} -eq 0 ]
then
echo "Instance ${ORACLE_SID} shutdown."
else
echo "Instance ${ORACLE_SID} NOT shutdown."
fi
fi;;
reset_logs)
fn_reset_logs;;
esac
else
echo ""
echo "Cant find init file for instance ${ORACLE_SID}."
fi
done
#if we are shutting down eveything then close down the agents too
if [ "${ALL_DATABASES}" = "Y" -a \( "$1" = "stop" -o "$1" = "STOP" \) -a ${BITS} = 64 ]
then
fn_stop_agent
fi
ORACLE_HOME=${ORIGINAL_ORACLE_HOME};export ORACLE_HOME
ORACLE_SID=${ORIGINAL_ORACLE_PATH};export ORACLE_SID
LD_LIBRARY_PATH=${ORIGINAL_LD_LIBRARY_PATH};export LD_LIBRARY_PATH
PATH=${ORIGINAL_PATH};export PATH
for VARIABLE in FILTER ORATAB_HOME ORATAB_SID ORATAB_START STATUS ORATAB \
PFILE SQL_COMMAND VERSION RETURN_STATUS RDBMS_HOME \
LISTENER_NAME FORCE ALL_DATABASES VERSION_MAJOR \
BITS LISTENER
do
unset ${VARIABLE}
done
unset VARIABLE) 2>&1 | tee /tmp/changedbstatus_ora.log
regards
Graham -
Network startup fails every time since 6/9 update [SOLVED]
I use the netctl method to start the network on my various machines (with static IP addresses) and since doing full system upgrades on 6/9, which included an update to systemd, the network fails to start on bootup, every time. I have to start the network manually after logging in.
I just read a post about a similar systemd-related problem (involving a new service) from which I quote: "yet another bunch of races to accompany the ones that have pestered the arch-linux bootup since that festering pile of race-ridden cs-student pipedream called systemd has been adopted into it."
Race conditions in network startup have been troublesome for me since systemd appeared. It's been quite some time now and the problems keep appearing. Much as I like Arch, I may have to abandon it, because this kind of basic unreliability is not acceptable.
Last edited by donallen (2014-06-10 18:34:35)Well, I did some more work on this, and I have a bit of egg on my face, with an excuse. You can decide for yourself whether you think it's a good one.
I run multiple machines that I use for different circumstances, e.g., travel. I rsync my home directory when moving from one machine to another. They are all set up identically, with Arch. To avoid confusion about which machine has the latest changes in my home directory, the scripts I use for rsync-ing and my .bash_profile send emails to my gmail address, so I have an audit trail of what I have done. In the past, I *have* experienced systemd troubles (and know that because the network didn't come up reliably and there was discussion by others on this forum of problems similar to mine, with patches for the systemd scripts) and the first symptom I saw was the inability of my .bash_profile to send my 'I just logged in on system X' email. Since the system update yesterday, I have been seeing this symptom. My mistake was assuming, instead of verifying, that the network had not come up, and just starting the network manually with netctl (there was no error message from netctl that I was starting an already-started network profile). My confusion was abetted by the fact that there was a systemd update yesterday, according to pacman. But, in fact, when I realized I was making an unwarranted assumption and actually checked, I found that the network had come up and I now believe this is not a systemd issue.
I think the issue is with mailx (mail), which also got updated yesterday. The mail I send requires authentication by the smtp server I'm using, and my scripts provide that, using the smtp-auth-* options to mail. This worked until yesterday. Looking at the mail man page, it appears that mail configuration and these options are about to change with version 15. The current version is 14.7 and purports to support both the old and new-style configuration and options. To turn on the new style, you supposedly invoke an option, -v15-compat, which is off by default. The options I'm using are not v15 compatible, but should work, since I have not provided the option to turn on v15 support. But it appears they do not.
I will mark this thread SOLVED, since my original diagnosis was wrong. -
Oracle 11gR2 systemd startup script
I would like to write down the systemd startup script here for I can't find any on the internet. wish people don't have to browse around and find nothing.
everything on internet is about 9i and no systemd startup script example.
I hv tried several times that the script runs right and start up oracle at bootup.
Issuing systemctl and it returns the following
oracle.service loaded active exited Oracle database serverthe script is working on my Fedora 18 x86_64.
Please give your input if you find mistake, error, or anything wrong.
Thank you
oracle.service
[Unit]
Description=Oracle database server
After=syslog.target network.target
[Service]
Type=oneshot
User=oracle
Group=oinstall
RemainAfterExit=yes
ExecStart=/bin/oracle.sh;
[Install]
WantedBy=multi-user.targetoracle.sh
#! /bin/bash
# script used by oracle.service
ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1
ORACLE_SID=orcl
ORACLE_BASE=/home/oracle/app/oracle/product/11.2.0
$ORACLE_HOME/bin/lsnrctl start;
$ORACLE_HOME/bin/dbstart $ORACLE_HOME;newbieRyan wrote:
I would like to write down the systemd startup script here for I can't find any on the internet. wish people don't have to browse around and find nothing.
everything on internet is about 9i and no systemd startup script example.Really??!?!?!
I googled 'start oracle on linux startup" and the very first hit is pretty much the standard reference on the subject: http://www.oracle-base.com/articles/linux/automating-database-startup-and-shutdown-on-linux.php
I hv tried several times that the script runs right and start up oracle at bootup.
Issuing systemctl and it returns the following
{code}
oracle.service loaded active exited Oracle database server
{code}
the script is working on my Fedora 18 x86_64.
Please give your input if you find mistake, error, or anything wrong.
Thank you
oracle.service
{code}
[Unit]
Description=Oracle database server
After=syslog.target network.target
[Service]
Type=oneshot
User=oracle
Group=oinstall
RemainAfterExit=yes
ExecStart=/bin/oracle.sh;
[Install]
WantedBy=multi-user.target
{code}
oracle.sh
{code}
#! /bin/bash
# script used by oracle.service
ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1
ORACLE_SID=orcl
ORACLE_BASE=/home/oracle/app/oracle/product/11.2.0
$ORACLE_HOME/bin/lsnrctl start;
$ORACLE_HOME/bin/dbstart $ORACLE_HOME;
{code} -
Office 2010 setup thru computer startup script
I am trying to install Office 2010 (sp2 seperate in the updates folder) thru group policy startup script and configured with OCT .msp file. Also try to start Access Runtime 2010 with SP2 update in the updates folder.
In group policy set run scripts asynchronisely disabled and run scripts visible enabled otherwise i could not see what the system was doiing also not when configiguring OCT with full display. The gpo settings lets the screens show during install so the user
can see what happens.
There is another problem that rises however: I have made 2 batchfiles and both are starting as a computer startup script in seperate gpo's (that is in another post). First the Accessruntime is installing, after that Office 2010 is running. Both are installed
after login but only one of the 2 have SP2 installed (7015) in this case Accessruntime has it. When i run only the Office 2010 install and not the Accesruntime 2010 then Office 2010 standard has also SP2 installed (version 7015). When running both only Runtime
has this sp2 and Office has 4763 this is without sp2 i believe.
In both folders (Office en Runtime) are the update files .msp in the updates folder of the installation, so thats ok.
Why is only 1 of the 2 installing the SP2 when running both?
A second thing is when restarting the system and before the login screen appears a message: Upgradepatch cannot be installed by Windows installer becasue the upgraded program does not excist of the upgradepatch is not suitable for this program?
Here is part of the batchfile:
IF EXIST "c:\program files\Microsoft Office\Office14\WINWORD.EXE" (goto mkfile) ELSE (goto DeployOffice)
:mkfile
ECHO Office 2010 is reeds geinstalleerd>c:\temp\office.txt
goto end
:DeployOffice
call cscript \\sharename\office2010\Offscrub03.vbs ALL /bypass 1 /q /s /NoCancel
start /wait %DeployServer%\setup.exe /adminfile %DeployServer%\officeconfig.msp
echo %date% %time% Setup ended with error code %errorlevel%. >> %LogLocation%\%computername%.txt
Another batchfile
start \\sharename\accessruntime2010\setup.exe /config \\share\accessruntime2010\config.xml
REM echo %date% %time% Setup ended with error code %errorlevel%. >> %LogLocation%\%computername%.txt
freddie
after installing both runtime and office both have SP2 in updates folder:
runtime 4763
Office 2010: 7015
So in this example runtme is installed without the SP2. installing runtime alone gives with SP2...
The message is gone. There was a other policy inherited from above that caused the message. The only problem now is that when installing both, runtime 2010 with SP2 files and Office 2010 with SP2 files, then one of the two don't get the Sp2 installed, why
is that?> In the bat file, I have a line that records if the install completes
> successfully or failed. I don't have any other logging in my
> script. Are you referring to something like GPO logging? I know that
> the script runs because when I am looking at one of the PCs, I can
So it is NOT GP related but rather your script fails?!? Put some "echo
%~n0 %date% %time%>>Log-File-Of-Your-Choice.txt" in it to check what's
going on. And put ">>Log-File-Of-Your-Choice.txt 2>&1" at the end of
critical commands to capture their output.
> I ran the gpresult /h command which shows all User Configuration
> policies, but NOTHING appears under the Computer Configuration section.
Admin commandline? If not, you don't see computer settings :)
Martin
Mal ein
GUTES Buch über GPOs lesen?
NO THEY ARE NOT EVIL, if you know what you are doing:
Good or bad GPOs?
And if IT bothers me - coke bottle design refreshment :))
Martin,
I still did not figure out why the installation script did not work for some of the PCs, even though the PCs have the same image. For the ones that don't work, I will install manually. Can you please look at the screenshots of the GPO
settings I am using, and let me know if there is any settings that I need to remove or add?
Thanks
Maybe you are looking for
-
[HELP!] My charger isn't working for some reason.
Hey everyone! I am having a problem with my charger. I can't quite clarify if it's broken or not, but I know that there is something wrong with my computer or the charger itself. As a mac user, I've gone through 2 chargers so far. I'm currently on my
-
How can i install garage band in my iPad with ios4
Ios4 seems to work beter with Io Dock alesis than ios5 i have a ios4 iPad 2. But the gband donwload reagires iOS 5!! How can i solve this
-
How do you open a Java Pop Up link in a new tab without looking at the properties of every link
In the next version of Firefox, please include an option when a user right-clicks a java pop-up link, there is an option to "open link in new tab". 90% of most links are "normal" links and not java popup links. It is actually frustrating when a link
-
Cannot get my airport express to allow multiple internet users.
Good morning. I recently had TW install internet and phone (cable, but no TV) at my home. My modem is a Scientific Altanta DPC 2203 and I have my AirPort Express hard-wired to the modem. I was able to access internet using my MacBook, but cannot g
-
X-Fi Xtreme Gamer 5.1 configurat
Hello everyone, I've got SB X-Fi Xtreme Gamer soundcard, I've installed all the applications from CD and newest web drivers and I still don't have sound in my both rear speakers. I've changed speaker configuration in all applications (Windows and Cre