Script to shutdown MainStage 3.0.3

I'm teching keyboards for a musical and would like to be able to include a script at the end of the show (triggered via footswitch) that 1. shuts down MainStage without saving changes (to prevent errant keyboard players from messing up the concert) and 2. then shuts down the computer.  I can write the script and run it from the editor window but when I run it in MainStage, I get a (null) error. 
Is what I want to do possible?  If it is, what am I missing?
Thanks for your help. 

Can I take it a step further? 
I figured out how to discard changes but I'd also like to shut down the computer.  I tried this:
on action(parameter)
          tell application "MainStage 3" to quit saving no
          tell application "Finder"
  shut down
          end tell
end action
and MainStage shut down as desired but the computer did not.  What did I miss?
Thanks for your help!

Similar Messages

  • Run a  script before shutdown with launchd

    Is there a way to run a shell script before shutdown with launchd? In 10.4, I have a shell script to remove user's folder when a user logs off.
    Lisa Perez

    the only way to do it that I know of is using a logout hook. see this link for details
    http://www.bombich.com/mactips/loginhooks.html
    However, I'm not sure exactly at what point in the logout process the logout hook is executed so there might be a problem running a script that deletes the home directory of the user that's being logged out.

  • How to properly execute script on shutdown using systemd

    Hello,
    I am trying to execute a simple script to update my freedns.afraid.org DNS record on each machine shutdown. Could somebody please provide me a complete step by step example on how to achieve this? There are many posts, but none work, directory structure is always different, and there are no results. Below is my current directory structure:
    [kbs1@arch ~]$ cd /etc/systemd/
    [kbs1@arch systemd]$ ll
    total 40
    drwxr-xr-x 5 root root 4096 Nov 1 06:55 .
    drwxr-xr-x 75 root root 4096 Nov 15 01:07 ..
    -rw-r--r-- 1 root root 529 May 30 14:55 bootchart.conf
    -rw-r--r-- 1 root root 770 Oct 2 14:01 journald.conf
    -rw-r--r-- 1 root root 709 Oct 2 14:01 logind.conf
    drwxr-xr-x 2 root root 4096 May 30 14:55 ntp-units.d
    drwxr-xr-x 7 root root 4096 Nov 18 13:24 system
    -rw-r--r-- 1 root root 1033 Oct 2 14:01 system.conf
    drwxr-xr-x 2 root root 4096 May 30 14:55 user
    -rw-r--r-- 1 root root 468 Oct 2 14:01 user.conf
    [kbs1@arch systemd]$ ll user
    total 8
    drwxr-xr-x 2 root root 4096 May 30 14:55 .
    drwxr-xr-x 5 root root 4096 Nov 1 06:55 ..
    [kbs1@arch systemd]$ ll system
    total 28
    drwxr-xr-x 7 root root 4096 Nov 18 13:24 .
    drwxr-xr-x 5 root root 4096 Nov 1 06:55 ..
    lrwxrwxrwx 1 root root 39 Sep 22 00:47 dbus-uk.org.thekelleys.dnsmasq -> /usr/lib/systemd/system/dnsmasq.service
    drwxr-xr-x 2 root root 4096 Jul 11 23:47 [email protected]
    drwxr-xr-x 2 root root 4096 Jul 8 06:16 getty.target.wants
    drwxr-xr-x 2 root root 4096 Nov 1 06:55 multi-user.target.wants
    drwxr-xr-x 2 root root 4096 Jul 20 00:45 printer.target.wants
    drwxr-xr-x 2 root root 4096 Jul 20 00:45 sockets.target.wants
    [kbs1@arch systemd]$ cd /usr/lib
    lib/ lib64/
    [kbs1@arch systemd]$ cd /usr/lib
    lib/ lib64/
    [kbs1@arch systemd]$ cd /usr/lib/sys
    sysctl.d/ systemd/
    [kbs1@arch systemd]$ cd /usr/lib/systemd/
    catalog/ systemd-hostnamed systemd-shutdown
    ntp-units.d/ systemd-initctl systemd-shutdownd
    scripts/ systemd-journald systemd-sleep
    system/ systemd-journal-gatewayd systemd-sysctl
    systemd systemd-localed systemd-timedated
    systemd-ac-power systemd-logind systemd-udevd
    systemd-activate systemd-machined systemd-update-utmp
    systemd-backlight systemd-modules-load systemd-user-sessions
    systemd-binfmt systemd-multi-seat-x systemd-vconsole-setup
    systemd-bootchart systemd-quotacheck system-generators/
    systemd-cgroups-agent systemd-random-seed system-shutdown/
    systemd-coredump systemd-readahead system-sleep/
    systemd-cryptsetup systemd-remount-fs user/
    systemd-fsck systemd-reply-password user-generators/
    [kbs1@arch systemd]$ cd /usr/lib/systemd/
    [kbs1@arch systemd]$ ll user
    total 20
    drwxr-xr-x 2 root root 4096 Nov 18 13:39 .
    drwxr-xr-x 11 root root 4096 Nov 18 13:37 ..
    lrwxrwxrwx 1 root root 40 Oct 21 15:27 bluetooth.target -> /usr/lib/systemd/system/bluetooth.target
    -rw-r--r-- 1 root root 373 Oct 21 15:27 default.target
    -rw-r--r-- 1 root root 499 Oct 21 15:27 exit.target
    lrwxrwxrwx 1 root root 36 Oct 21 15:27 paths.target -> /usr/lib/systemd/system/paths.target
    lrwxrwxrwx 1 root root 38 Oct 21 15:27 printer.target -> /usr/lib/systemd/system/printer.target
    lrwxrwxrwx 1 root root 39 Oct 21 15:27 shutdown.target -> /usr/lib/systemd/system/shutdown.target
    lrwxrwxrwx 1 root root 40 Oct 21 15:27 smartcard.target -> /usr/lib/systemd/system/smartcard.target
    lrwxrwxrwx 1 root root 38 Oct 21 15:27 sockets.target -> /usr/lib/systemd/system/sockets.target
    lrwxrwxrwx 1 root root 36 Oct 21 15:27 sound.target -> /usr/lib/systemd/system/sound.target
    -rw-r--r-- 1 root root 501 Oct 21 15:27 systemd-exit.service
    lrwxrwxrwx 1 root root 37 Oct 21 15:27 timers.target -> /usr/lib/systemd/system/timers.target
    [kbs1@arch systemd]$ ll system
    total 856
    drwxr-xr-x 10 root root 12288 Nov 1 06:56 .
    drwxr-xr-x 11 root root 4096 Nov 18 13:37 ..
    -rw-r--r-- 1 root root 428 Jul 29 11:49 alsa-restore.service
    -rw-r--r-- 1 root root 481 Jul 29 11:49 alsa-state.service
    -rw-r--r-- 1 root root 372 Jul 29 11:49 alsa-store.service
    lrwxrwxrwx 1 root root 14 Oct 21 15:27 [email protected] -> [email protected]
    -rw-r--r-- 1 root root 1042 Oct 31 17:31 avahi-daemon.service
    -rw-r--r-- 1 root root 874 Oct 31 17:31 avahi-daemon.socket
    -rw-r--r-- 1 root root 975 Oct 31 17:31 avahi-dnsconfd.service
    -rw-r--r-- 1 root root 546 Oct 21 15:27 basic.target
    drwxr-xr-x 2 root root 4096 Aug 7 16:14 basic.target.wants
    -rw-r--r-- 1 root root 379 Oct 21 15:27 bluetooth.target
    -rw-r--r-- 1 root root 296 Jul 23 16:00 colord.service
    -rw-r--r-- 1 root root 699 Oct 21 15:27 console-getty.service
    -rw-r--r-- 1 root root 722 Oct 21 15:27 console-shell.service
    -rw-r--r-- 1 root root 194 Jun 23 11:17 cronie.service
    -rw-r--r-- 1 root root 366 Oct 21 15:27 cryptsetup.target
    lrwxrwxrwx 1 root root 13 Oct 21 15:27 ctrl-alt-del.target -> reboot.target
    -rw-r--r-- 1 root root 224 Oct 30 15:59 cups-browsed.service
    lrwxrwxrwx 1 root root 12 Oct 25 21:12 cupsd.service -> cups.service
    -rw-r--r-- 1 root root 126 Oct 25 21:12 cups.path
    -rw-r--r-- 1 root root 158 Oct 25 21:12 cups.service
    -rw-r--r-- 1 root root 127 Oct 25 21:12 cups.socket
    lrwxrwxrwx 1 root root 25 Oct 21 15:27 dbus-org.freedesktop.hostname1.service -> systemd-hostnamed.service
    lrwxrwxrwx 1 root root 23 Oct 21 15:27 dbus-org.freedesktop.locale1.service -> systemd-localed.service
    lrwxrwxrwx 1 root root 22 Oct 21 15:27 dbus-org.freedesktop.login1.service -> systemd-logind.service
    lrwxrwxrwx 1 root root 24 Oct 21 15:27 dbus-org.freedesktop.machine1.service -> systemd-machined.service
    lrwxrwxrwx 1 root root 25 Oct 21 15:27 dbus-org.freedesktop.timedate1.service -> systemd-timedated.service
    -rw-r--r-- 1 root root 353 Oct 12 16:22 dbus.service
    -rw-r--r-- 1 root root 102 Oct 12 16:22 dbus.socket
    drwxr-xr-x 2 root root 4096 Nov 1 06:55 dbus.target.wants
    -rw-r--r-- 1 root root 978 Oct 21 15:27 debug-shell.service
    lrwxrwxrwx 1 root root 16 Oct 21 15:27 default.target -> graphical.target
    -rw-r--r-- 1 root root 156 Aug 25 09:57 deluged.service
    -rw-r--r-- 1 root root 145 Aug 25 09:57 deluge-web.service
    -rw-r--r-- 1 root root 636 Oct 21 15:27 dev-hugepages.mount
    -rw-r--r-- 1 root root 590 Oct 21 15:27 dev-mqueue.mount
    -rw-r--r-- 1 root root 227 Aug 3 17:20 dhcpcd.service
    -rw-r--r-- 1 root root 318 Aug 3 17:20 [email protected]
    -rw-r--r-- 1 root root 305 Oct 23 19:30 dmeventd.service
    -rw-r--r-- 1 root root 243 Oct 23 19:30 dmeventd.socket
    -rw-r--r-- 1 root root 383 Oct 30 16:17 dnsmasq.service
    -rw-r--r-- 1 root root 940 Oct 21 15:27 emergency.service
    -rw-r--r-- 1 root root 431 Oct 21 15:27 emergency.target
    -rw-r--r-- 1 root root 149 May 29 05:46 fancontrol.service
    -rw-r--r-- 1 root root 440 Oct 21 15:27 final.target
    -rw-r--r-- 1 root root 141 Sep 12 06:38 ftpd.service
    -rw-r--r-- 1 root root 1486 Oct 21 15:27 [email protected]
    -rw-r--r-- 1 root root 460 Oct 21 15:27 getty.target
    -rw-r--r-- 1 root root 253 Oct 29 01:28 [email protected]
    -rw-r--r-- 1 root root 112 Oct 29 01:28 git-daemon.socket
    -rw-r--r-- 1 root root 161 Oct 24 19:10 gpm.service
    -rw-r--r-- 1 root root 522 Oct 21 15:27 graphical.target
    -rw-r--r-- 1 root root 487 Oct 21 15:27 halt.target
    -rw-r--r-- 1 root root 199 May 29 05:46 healthd.service
    -rw-r--r-- 1 root root 447 Oct 21 15:27 hibernate.target
    -rw-r--r-- 1 root root 337 Jul 18 21:07 httpd.service
    -rw-r--r-- 1 root root 468 Oct 21 15:27 hybrid-sleep.target
    -rw-r--r-- 1 root root 596 Oct 21 15:27 initrd-cleanup.service
    -rw-r--r-- 1 root root 536 Oct 21 15:27 initrd-fs.target
    -rw-r--r-- 1 root root 763 Oct 21 15:27 initrd-parse-etc.service
    -rw-r--r-- 1 root root 509 Oct 21 15:27 initrd-root-fs.target
    -rw-r--r-- 1 root root 606 Oct 21 15:27 initrd-switch-root.service
    -rw-r--r-- 1 root root 691 Oct 21 15:27 initrd-switch-root.target
    -rw-r--r-- 1 root root 654 Oct 21 15:27 initrd.target
    -rw-r--r-- 1 root root 668 Oct 21 15:27 initrd-udevadm-cleanup-db.service
    -rw-r--r-- 1 root root 319 Jun 1 07:35 ip6tables.service
    -rw-r--r-- 1 root root 308 Jun 1 07:35 iptables.service
    -rw-r--r-- 1 root root 162 Oct 14 08:42 irexec.service
    -rw-r--r-- 1 root root 501 Oct 21 15:27 kexec.target
    -rw-r--r-- 1 root root 721 Oct 21 15:27 kmod-static-nodes.service
    -rw-r--r-- 1 root root 137 Jun 10 08:46 krb5-kadmind.service
    -rw-r--r-- 1 root root 129 Jun 10 08:46 krb5-kdc.service
    -rw-r--r-- 1 root root 128 Jun 10 08:46 krb5-kpropd.service
    -rw-r--r-- 1 root root 159 Jun 10 08:46 [email protected]
    -rw-r--r-- 1 root root 122 Jun 10 08:46 krb5-kpropd.socket
    -rw-r--r-- 1 root root 177 Oct 14 08:42 lircm.service
    -rw-r--r-- 1 root root 225 Oct 14 08:42 lirc.service
    -rw-r--r-- 1 root root 348 May 29 05:46 lm_sensors.service
    -rw-r--r-- 1 root root 395 Oct 21 15:27 local-fs-pre.target
    -rw-r--r-- 1 root root 489 Oct 21 15:27 local-fs.target
    drwxr-xr-x 2 root root 4096 Nov 1 06:55 local-fs.target.wants
    -rw-r--r-- 1 root root 332 Oct 23 19:30 lvmetad.service
    -rw-r--r-- 1 root root 239 Oct 23 19:30 lvmetad.socket
    -rw-r--r-- 1 root root 504 Oct 23 19:30 lvm-monitoring.service
    -rw-r--r-- 1 root root 277 Sep 13 15:11 lxdm.service
    -rw-r--r-- 1 root root 405 Oct 21 15:27 machine.slice
    -rw-r--r-- 1 root root 130 Sep 4 16:24 mdadm.service
    -rw-r--r-- 1 root root 524 Oct 21 15:27 multi-user.target
    drwxr-xr-x 2 root root 4096 Nov 1 06:55 multi-user.target.wants
    -rw-r--r-- 1 root root 264 Sep 24 14:50 mysqld.service
    -rw-r--r-- 1 root root 404 Aug 6 10:46 [email protected]
    -rw-r--r-- 1 root root 317 Aug 6 10:46 [email protected]
    -rw-r--r-- 1 root root 238 Aug 6 10:46 netctl.service
    -rw-r--r-- 1 root root 290 Aug 6 10:46 [email protected]
    -rw-r--r-- 1 root root 248 Aug 6 10:46 netctl-sleep.service
    -rw-r--r-- 1 root root 443 Oct 21 15:27 network-online.target
    -rw-r--r-- 1 root root 433 Oct 21 15:27 network.target
    -rw-r--r-- 1 root root 400 Oct 25 17:29 nscd.service
    -rw-r--r-- 1 root root 514 Oct 21 15:27 nss-lookup.target
    -rw-r--r-- 1 root root 473 Oct 21 15:27 nss-user-lookup.target
    -rw-r--r-- 1 root root 207 Aug 1 05:29 ntpdate.service
    -rw-r--r-- 1 root root 210 Aug 1 05:29 ntpd.service
    -rw-r--r-- 1 root root 354 Oct 21 15:27 paths.target
    -rw-r--r-- 1 root root 172 Sep 18 19:20 polkit.service
    -rw-r--r-- 1 root root 287 Sep 6 04:01 postfix.service
    -rw-r--r-- 1 root root 500 Oct 21 15:27 poweroff.target
    -rw-r--r-- 1 root root 377 Oct 21 15:27 printer.target
    -rw-r--r-- 1 root root 693 Oct 21 15:27 proc-sys-fs-binfmt_misc.automount
    -rw-r--r-- 1 root root 603 Oct 21 15:27 proc-sys-fs-binfmt_misc.mount
    -rw-r--r-- 1 root root 641 Oct 21 15:27 quotaon.service
    -rw-r--r-- 1 root root 493 Oct 21 15:27 reboot.target
    -rw-r--r-- 1 root root 396 Oct 21 15:27 remote-fs-pre.target
    -rw-r--r-- 1 root root 482 Oct 21 15:27 remote-fs.target
    -rw-r--r-- 1 root root 958 Oct 21 15:27 rescue.service
    -rw-r--r-- 1 root root 486 Oct 21 15:27 rescue.target
    -rw-r--r-- 1 root root 500 Oct 21 15:27 rpcbind.target
    -rw-r--r-- 1 root root 127 Oct 28 17:58 [email protected]
    -rw-r--r-- 1 root root 115 Oct 28 17:58 saned.socket
    -rw-r--r-- 1 root root 158 May 29 05:46 sensord.service
    -rw-r--r-- 1 root root 989 Oct 21 15:27 [email protected]
    -rw-r--r-- 1 root root 402 Oct 21 15:27 shutdown.target
    drwxr-xr-x 2 root root 4096 Oct 7 05:47 shutdown.target.wants
    -rw-r--r-- 1 root root 362 Oct 21 15:27 sigpwr.target
    -rw-r--r-- 1 root root 420 Oct 21 15:27 sleep.target
    -rw-r--r-- 1 root root 403 Oct 21 15:27 -.slice
    -rw-r--r-- 1 root root 409 Oct 21 15:27 slices.target
    -rw-r--r-- 1 root root 380 Oct 21 15:27 smartcard.target
    -rw-r--r-- 1 root root 279 Aug 11 18:43 smartd.service
    -rw-r--r-- 1 root root 266 Aug 17 12:20 snmpd.service
    -rw-r--r-- 1 root root 283 Aug 17 12:20 snmptrapd.service
    -rw-r--r-- 1 root root 356 Oct 21 15:27 sockets.target
    drwxr-xr-x 2 root root 4096 Nov 1 06:56 sockets.target.wants
    -rw-r--r-- 1 root root 380 Oct 21 15:27 sound.target
    -rw-r--r-- 1 root root 221 Oct 27 01:00 speech-dispatcherd.service
    -rw-r--r-- 1 root root 511 Sep 13 11:00 sshdgenkeys.service
    -rw-r--r-- 1 root root 410 Sep 13 11:00 sshd.service
    -rw-r--r-- 1 root root 156 Sep 13 11:00 [email protected]
    -rw-r--r-- 1 root root 128 Sep 13 11:00 sshd.socket
    -rw-r--r-- 1 root root 441 Oct 21 15:27 suspend.target
    -rw-r--r-- 1 root root 270 Sep 13 05:38 svnserve.service
    -rw-r--r-- 1 root root 353 Oct 21 15:27 swap.target
    -rw-r--r-- 1 root root 681 Oct 21 15:27 sys-fs-fuse-connections.mount
    -rw-r--r-- 1 root root 540 Oct 21 15:27 sysinit.target
    drwxr-xr-x 2 root root 4096 Nov 1 06:55 sysinit.target.wants
    -rw-r--r-- 1 root root 685 Oct 21 15:27 sys-kernel-config.mount
    -rw-r--r-- 1 root root 628 Oct 21 15:27 sys-kernel-debug.mount
    -rw-r--r-- 1 root root 1235 Oct 21 15:27 syslog.socket
    -rw-r--r-- 1 root root 646 Oct 21 15:27 systemd-ask-password-console.path
    -rw-r--r-- 1 root root 657 Oct 21 15:27 systemd-ask-password-console.service
    -rw-r--r-- 1 root root 574 Oct 21 15:27 systemd-ask-password-wall.path
    -rw-r--r-- 1 root root 689 Oct 21 15:27 systemd-ask-password-wall.service
    -rw-r--r-- 1 root root 784 Oct 21 15:27 [email protected]
    -rw-r--r-- 1 root root 1015 Oct 21 15:27 systemd-binfmt.service
    -rw-r--r-- 1 root root 696 Oct 21 15:27 systemd-fsck-root.service
    -rw-r--r-- 1 root root 656 Oct 21 15:27 [email protected]
    -rw-r--r-- 1 root root 548 Oct 21 15:27 systemd-halt.service
    -rw-r--r-- 1 root root 505 Oct 21 15:27 systemd-hibernate.service
    -rw-r--r-- 1 root root 642 Oct 21 15:27 systemd-hostnamed.service
    -rw-r--r-- 1 root root 523 Oct 21 15:27 systemd-hybrid-sleep.service
    -rw-r--r-- 1 root root 484 Oct 21 15:27 systemd-initctl.service
    -rw-r--r-- 1 root root 489 Oct 21 15:27 systemd-initctl.socket
    -rw-r--r-- 1 root root 940 Oct 21 15:27 systemd-journald.service
    -rw-r--r-- 1 root root 833 Oct 21 15:27 systemd-journald.socket
    -rw-r--r-- 1 root root 702 Oct 21 15:27 systemd-journal-flush.service
    -rw-r--r-- 1 root root 582 Oct 21 15:27 systemd-journal-gatewayd.service
    -rw-r--r-- 1 root root 406 Oct 21 15:27 systemd-journal-gatewayd.socket
    -rw-r--r-- 1 root root 561 Oct 21 15:27 systemd-kexec.service
    -rw-r--r-- 1 root root 591 Oct 21 15:27 systemd-localed.service
    -rw-r--r-- 1 root root 972 Oct 21 15:27 systemd-logind.service
    -rw-r--r-- 1 root root 667 Oct 21 15:27 systemd-machined.service
    -rw-r--r-- 1 root root 1029 Oct 21 15:27 systemd-modules-load.service
    -rw-r--r-- 1 root root 478 Oct 21 15:27 [email protected]
    -rw-r--r-- 1 root root 557 Oct 21 15:27 systemd-poweroff.service
    -rw-r--r-- 1 root root 688 Oct 21 15:27 systemd-quotacheck.service
    -rw-r--r-- 1 root root 777 Oct 21 15:27 systemd-random-seed.service
    -rw-r--r-- 1 root root 845 Oct 21 15:27 systemd-readahead-collect.service
    -rw-r--r-- 1 root root 615 Oct 21 15:27 systemd-readahead-done.service
    -rw-r--r-- 1 root root 593 Oct 21 15:27 systemd-readahead-done.timer
    -rw-r--r-- 1 root root 555 Oct 21 15:27 systemd-readahead-drop.service
    -rw-r--r-- 1 root root 757 Oct 21 15:27 systemd-readahead-replay.service
    -rw-r--r-- 1 root root 552 Oct 21 15:27 systemd-reboot.service
    -rw-r--r-- 1 root root 828 Oct 21 15:27 systemd-remount-fs.service
    -rw-r--r-- 1 root root 479 Oct 21 15:27 systemd-shutdownd.service
    -rw-r--r-- 1 root root 528 Oct 21 15:27 systemd-shutdownd.socket
    -rw-r--r-- 1 root root 501 Oct 21 15:27 systemd-suspend.service
    -rw-r--r-- 1 root root 900 Oct 21 15:27 systemd-sysctl.service
    -rw-r--r-- 1 root root 593 Oct 21 15:27 systemd-timedated.service
    -rw-r--r-- 1 root root 853 Oct 21 15:27 systemd-tmpfiles-clean.service
    -rw-r--r-- 1 root root 450 Oct 21 15:27 systemd-tmpfiles-clean.timer
    -rw-r--r-- 1 root root 622 Oct 21 15:27 systemd-tmpfiles-setup-dev.service
    -rw-r--r-- 1 root root 915 Oct 21 15:27 systemd-tmpfiles-setup.service
    -rw-r--r-- 1 root root 578 Oct 21 15:27 systemd-udevd-control.socket
    -rw-r--r-- 1 root root 575 Oct 21 15:27 systemd-udevd-kernel.socket
    -rw-r--r-- 1 root root 772 Oct 21 15:27 systemd-udevd.service
    -rw-r--r-- 1 root root 827 Oct 21 15:27 systemd-udev-settle.service
    -rw-r--r-- 1 root root 723 Oct 21 15:27 systemd-udev-trigger.service
    -rw-r--r-- 1 root root 761 Oct 21 15:27 systemd-update-utmp-runlevel.service
    -rw-r--r-- 1 root root 831 Oct 21 15:27 systemd-update-utmp.service
    -rw-r--r-- 1 root root 558 Oct 21 15:27 systemd-user-sessions.service
    -rw-r--r-- 1 root root 690 Oct 21 15:27 systemd-vconsole-setup.service
    -rw-r--r-- 1 root root 433 Oct 21 15:27 system.slice
    -rw-r--r-- 1 root root 652 Oct 21 15:27 system-update.target
    -rw-r--r-- 1 root root 355 Oct 21 15:27 timers.target
    drwxr-xr-x 2 root root 4096 Nov 1 06:55 timers.target.wants
    -rw-r--r-- 1 root root 509 Oct 21 15:27 time-sync.target
    -rw-r--r-- 1 root root 591 Oct 21 15:27 tmp.mount
    -rw-r--r-- 1 root root 155 May 17 2013 udisks.service
    -rw-r--r-- 1 root root 417 Oct 21 15:27 umount.target
    -rw-r--r-- 1 root root 584 Oct 21 15:27 [email protected]
    -rw-r--r-- 1 root root 392 Oct 21 15:27 user.slice
    -rw-r--r-- 1 root root 202 Oct 21 16:31 uuidd.service
    -rw-r--r-- 1 root root 126 Oct 21 16:31 uuidd.socket
    -rw-r--r-- 1 root root 221 Oct 29 22:58 vboxweb.service
    -rw-r--r-- 1 root root 160 May 12 2013 vsftpd.service
    -rw-r--r-- 1 root root 163 May 12 2013 [email protected]
    -rw-r--r-- 1 root root 104 May 12 2013 vsftpd.socket
    -rw-r--r-- 1 root root 201 May 12 2013 vsftpd-ssl.service
    -rw-r--r-- 1 root root 226 May 12 2013 [email protected]
    -rw-r--r-- 1 root root 105 May 12 2013 vsftpd-ssl.socket
    -rw-r--r-- 1 root root 349 Sep 30 11:32 xmms2d.service
    [kbs1@arch systemd]$
    Could someone tell me which file to create, exactly where, and what symlink to link to it? Also, what commands to type then? I just want to execute these simple commands:
    echo "Updating dynamic IP at freedns.afraid.org..."
    wget -qO- http://freedns.afraid.org/dynamic/update.php?YYY &> /dev/null
    Thank you very much! I'm sure this will help others as well.

    Start by reading systemd.unit(5) and systemd.service(5)

  • Reg : Script for shutdown startup  in  oracle9i

    Hi,
    I need shutdown and startup sqlfiles script while taking Coldbackup in oracle9i.

    U need to perform a cold backup using a script? this one will create a backup from SQL*Plus connected as SYSDBA.
    Rem Set SQL*Plus variables to manipulate output
    set feedback off heading off verify off
    set pagesize 0 linesize 200
    Rem Set SQL*Plus user variables used in script
    Rem Linux User variables
    define dir = '/backup'
    define fil = '/tmp/closed_backup_commands.sql'
    prompt *** Spooling to &fil
    spool &fil
    select 'host cp '|| name ||' &dir' from v$datafile order by 1;
    select 'host cp '|| member ||' &dir' from v$logfile order by 1;
    select 'host cp '|| name ||' &dir' from v$controlfile order by 1;
    select 'host cp '|| name ||' &dir' from v$tempfile order by 1;
    spool off;
    Rem Shutdown the database cleanly
    shutdown immediate;
    Rem Run the copy file commands
    @&fil
    Rem Start the database again
    startup;
    On Linux, connect to SQL*Plus as SYSDBA and run this script like this:
    LINUX> sqlplus /nolog
    SQL> connect system/manager as sysdba
    SQL> @closed_backup.sql

  • Script to shutdown all databases run in the particular ORACLE_HOME

    Hello,
    I am searching for a shell script that would shutdown all the databases running in a particular ORACLE_HOME and then startup the same exact databases up again after a 'relink all' has been performed.
    There are other databases in the particular ORACLE_HOME that are not running and I do not want to start thoses. I only want to shutdown and startup again only those databases that were running in the particular ORACLE_HOME. Thank you.

    902029 wrote:
    Hello,
    I am searching for a shell script that would shutdown all the databases running in a particular ORACLE_HOME and then startup the same exact databases up again after a 'relink all' has been performed.
    There are other databases in the particular ORACLE_HOME that are not running and I do not want to start thoses. I only want to shutdown and startup again only those databases that were running in the particular ORACLE_HOME. Thank you.vi db_stop_all.sh
    and paste the below code. Here in ORASID you have to mention all the SID's which you want to shutdown.
    export ORACLE_HOME=your oracle home
    export PATH=$ORACLE_HOME/bin:$PATH
    datestr=`date +20%y-%m-%d-%H.%M.%S`
    logfile=db_shut_log_$datestr.log
    ORAENV_ASK=NO
    for ORASID in prod dev test
    do
    export ORACLE_SID=$ORASID
    sqlplus "/as sysdba" <<!
    spool DB_$ORASID.log
    set echo off
    set lines 300
    set pages 300
    col object_name for a30
    select to_char(sysdate, 'dd-mon-yy hh24:mi:ss') from dual;
    select instance_name,to_char(STARTUP_TIME, 'dd-mon-yy hh24:mi:ss') as "STARTUP_TIME",host_name from v\$instance;
    select name,open_mode from v\$database;
    shutdown immediate;
    spool off
    cat DB_*.log >> $logfile
    done
    rm DB_*.log
    df -k >> $logfile

  • Script to shutdown the computer

    Is there script available that can be deployed to collection to shutdown the machines. If someone is logged on to the machine they get a prompt and can cancel the shutdown.
    We should be able to depoy the script through SCCM 2012 R2.

    Probably not prewritten, but that should be easy to write.
    Don't retire TechNet! -
    (Don't give up yet - 12,830+ strong and growing)

  • N5K EEM script to shutdown interface if CDP neighbor drops

    Hi
    Total n00b on EEM here. Background - we have an inline transparent L2 firewall sitting between our Nexus core switch and our UCS. If the physical interfaces on one of the firewalls go down, our UCS virtual hosts can detect that and will automatically fail over to their other NIC and network connectivity is restored. However if theres a software or process problem on the firewall we can lose connectivity to half of the UCS because all the links are physically staying up but the server traffic is getting blackholed.
    If the L2 firewall stops passing traffic we will lose the CDP neighbor entry for the UCS on the N5K. If that happens I want to shut down the port channel interface that connects the Nexus to the firewall, triggering the virtual hosts to fail over to their second NIC.
    Basically
    1)     Check for presence of CDP neighbor on e1/17
    2)     If there is an entry there do nothing
    3)     If there is no entry there then issue the following cli commands "conf t, interface port-channel 17, shutdown"
    I would like the switch to execute the script once per minute all day every day.
    NEXUS-SW1# sh cdp ne int e1/17
    Capability Codes: R - Router, T - Trans-Bridge, B - Source-Route-Bridge
                      S - Switch, H - Host, I - IGMP, r - Repeater,
                      V - VoIP-Phone, D - Remotely-Managed-Device,
                      s - Supports-STP-Dispute
    Device-ID             Local Intrfce Hldtme Capability  Platform      Port ID
    UCS-FABRIC-A(SSI171402MC)
                        Eth1/17        173    S I s     UCS-FI-6248UP Eth1/17
    NEXUS-SW1#
    Could anyone give me a hand on a script to do this please? Looks like there is EEM neighbor discovery stuff in IOS but not NX-OS on the 5K, so I think this script will have to use the CLI to detect failure. Thanks

    I'm running the latest 6.0(2)N2(1) NX-OS on the 5548 with the Layer 3 daughtercard and LAN Enterprise Services license. There is some EEM stuff in the CLI but it appears basic compared to what is in IOS.
    NEXUS-SW1(config-applet)# event ?
      cli             Create a cli event specification
      counter         Create a counter event
      fanabsent       Create fanabsent event specification
      fanbad          Create fanbad event specification
      oir             Create Online-Insertion-Removal event specification
      policy-default  Use the event in the system policy being overridden
      snmp            Create a 'snmp' event specification.
      storm-control   Create a storm control event specification
      syslog          Create a syslog event specification
      sysmgr          System manager related events
      temperature     Create temperature event specification
      track           Create a 'track' event specification
    NEXUXS-SW1(config-applet)# event cli ?
      match  Enter cli regex to be used for matching
      tag    Event tag identifier
    I was hoping I could use the "event cli match" or something like that to detect the loss of the cdp neighbor. And then shut down the interface if it is not there.

  • L3 Switch script to shutdown a port based IP reachability

    Hello all,
    I would like to know if using EEM I can shutdown a Gigabit interface based on IP reachability of the remote neighbor via ping?
    And no shutdown when the IP reachability is reestablished? I'm Using IOS-XE
    I ask this because I've a L2 connection which is not directly end-to-end but it have some network component (DWDM) in the middle for signal regeneration.
    The provider of the DWDM circuit confirm that the signal is NOT end-to-end so in case there is a failure ine the circuit the interfaces of the L3 switches won't go down and the traffic is still routed on this path since on the Routing table he routes are still present also if the remote neighbor is not reachable
    should I Use the track with the event manager applet IOS commands???
    Many Thanks
    Saluti

    I would recommend looking at feature based capabilities before implementing things with EEM... This way it would be easier to support etc...
    The functionality you are asking for should be available on your platform (I assume you are on ASR1K as you are mentioning IOS-XE). You should look at BFD...
    Here are a few references:
    http://www.cisco.com/en/US/docs/ios-xml/ios/iproute_bfd/configuration/xe-3s/irb-bi-fwd-det.html
    You mentioned static routes, so maybe this is also relevant:
    http://www.cisco.com/en/US/docs/ios-xml/ios/iproute_bfd/configuration/xe-3s/irb-xe-3s-book_chapter_01000.html
    Arie

  • Startup and shutdown script for EP 60SP2 Unix

    Does anyone have a working script to shutdown and startup EP 60 SP2 on unix (solaris) that they would like to share.....
    Needed for sys ops to be able to log n and stop and start....and for admins to start and stop at the unix if server needs rebooted (for solaris patches, scheduled maintenance windows etc etc)
    Thanks
    John Ryan

    Hi John,
    The scripts below can be used to start the J2EE engine/portal so it gets you halfway there (doesn't stop).  The script also creates the log ouput under the tmp directory).  Then from a command you just have to type startdisp.sh or whatever script you're trying to run.
    PS. If you have your r3startup service set to automatic, you can just use the dispatcher script below.
    Hope this helps.
    Marty
    UNIXSERVER% more startdisp.sh
    #!/bin/ksh
    nohup cluster/dispatcher/go > /tmp/dispatcher.$$.out 2>&1 &
    UNIXSERVER% more startserver.sh
    #!/bin/ksh
    nohup cluster/server/go > /tmp/server.$$.out 2>&1 &
    UNIXSERVER% more startstate.sh
    #!/bin/ksh
    nohup cluster/state/go > /tmp/state.$$.out 2>&1 &

  • Automate startup/shutdown thru script on windows

    WIndows 2003
    oracle 9.2.0.7
    I am new to oracle on windows.
    Is there way to automated startup/shutdown database thru script on windows?
    I want to schedule this task at perticuler time.
    Thanks

    You have to come up with your own script to shutdown.
    There's a sample here
    [Start / Shut Oracle with a Click (Windows Script) |http://it.toolbox.com/wiki/index.php/Start_/_Shut_Oracle_with_a_Click_(Windows_Script)]
    Edited by: yingkuan on Oct 9, 2008 5:05 PM

  • Script to completely shutdown the concurrent manager

    Use this script to shutdown the concurrent manager completely. It will wait till all processes die.
    #!/bin/sh
    # Author: Praveen Gattu
    # Created: June 2007
    # Figure out how you want to pass the variables DB_USER (username
    # for APPS schema) and DB_PSWD (password for APPS). You can
    # hardcode in this script (not recommended), prompt the user
    # to enter them, etc.
    # stop the concurrent manager
    $SCRIPTS_TOP/adcmctl.sh stop $DB_USER/$DB_PSWD
    # check if the processes are alive
    SPOOL_FILE="$APPLTMP/stop_cm_$TWO_TASK.tmp"
    while [ "$RETURN_VALUE" != "0" ]; do
    sqlplus -silent $DB_USER/$DB_PSWD << EOF
    spool $SPOOL_FILE
    select concurrent_queue_name, running_processes
    from fnd_concurrent_queues
    where running_processes > 0;
    spool off
    EOF
    egrep --silent "no rows selected" $SPOOL_FILE
    RETURN_VALUE=$?
    if [ $RETURN_VALUE -ne 0 ]; then
    echo "Concurrent manager processes are still active. Sleeping for 10 seconds..."
    sleep 10
    fi
    done
    rm $SPOOL_FILE
    echo "** Concurrent Manager and its processes are stopped **"

    Far as I know DSH exist by default in AIX env, but you can create it on Linux\Unix env.
    Creating DSH in a Linux Env.
    1 - Configure passwordless SSH between Nodes using root user.
    2 - Create a file /etc/dsh.conf with all hostsname separated with space in a line ( ex. node1 node2 node3)
    3-  Create a script "/usr/local/scripts/dsh" as follow:
    #!/bin/bash
    COMANDO=$*
    NODES=`cat /etc/dsh.conf`
         for NODE in $NODES
         do
         echo $NODE:
    ssh $NODE $COMANDO
         done
    exit 0
    4 - Change permission of file /usr/local/scripts/dsh to 775
    Just run
    # /usr/local/scripts/dsh date
    or
    # /usr/local/scripts/dsh /u01/app/grid/bin/crsctl stop crs

  • 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

  • My 'run with administrative privileges' script no longer works - help

    Hey all. I have an applescript that shuts down the computer that I made a while back. I pulled it out today to use it and it no longer works. Here's part of the code I'm having trouble with:
    do shell script ¬
    "sudo shutdown -h now" password "myadminpassword" with administrator privileges
    On old machines this worked great, I would just put the admin password where myadminpassword is and it would work perfectly. Now though, I run it on my machine and I get the prompt to enter my admin username and password before it will shutdown.
    Now this is going on a remote install so I need it to work. Any ideas? The machine is running snow leopard, but it seems to still work on an old leopard macbook pro.

    Well, for one, do not use sudo in do shell script.
    The whole 'with administrator privileges' part takes care of elevating your privileges. sudo has no place in do shell script.
    Don't know if that's your issue, but it's the first thing I'd fix.
    If that doesn't help, are you running the script as your admin user?
    Nowhere in your script are you defining the username to run the command as, therefore it will attempt to run as the current user who may not be the same as your admin user, nor have the same password. You might need to include the username:
    do shell script "shutdown -h now" user name "admin" password "myadminpassword" with administrator privileges

  • WebLogic Datasources : Automatically Shutdown and Start up

    Hi there,
    I have a problem with my datasources, I have WLST script which shutdown and start automatically some datasources in my environment, all of them in my crontab !
    Follow exactly my script !
    [weblogic@wls_server restartDS]$ cat shutdownDS1.py | more
    connect('weblogic','password','t3://server:10000')
    domainConfig()
    servers = cmo.getServers()
    domainRuntime()
    for server in servers:
    try:
    print 'check ' + server.getName()
    print '/ServerRuntimes/' + server.getName() + '/JDBCServiceRuntime/' + server.getName() + '/JDBCDataSourceRuntimeMBeans/MYDATASOURCE-XA1'
    cd('ServerRuntimes/' + server.getName() + '/JDBCServiceRuntime/' + server.getName() + '/JDBCDataSourceRuntimeMBeans/MYDATASOURCE-XA1')
    objectArray = jarray.array([], java.lang.Object)
    stringArray = jarray.array([], java.lang.String)
    invoke('shutdown', objectArray, stringArray)
    except WLSTException,e:
    print server.getName() + 'is not running.'
    for server in servers:
    try:
    print 'check ' + server.getName()
    print '/ServerRuntimes/' + server.getName() + '/JDBCServiceRuntime/' + server.getName() + '/JDBCDataSourceRuntimeMBeans/MYDATASOURCE-XA2'
    cd('ServerRuntimes/' + server.getName() + '/JDBCServiceRuntime/' + server.getName() + '/JDBCDataSourceRuntimeMBeans/MYDATASOURCE-XA2')
    objectArray = jarray.array([], java.lang.Object)
    stringArray = jarray.array([], java.lang.String)
    invoke('shutdown', objectArray, stringArray)
    except WLSTException,e:
    print server.getName() + 'is not running.'
    exit()
    Don´t worry, I have another script which kill XA3 and XA4 datasources as well, so, this way, I have load balancing here !
    It works with CRONTAB !
    The problem here is : Doesn´t matter if datasources are running or not, simply , datasources automatically shutdown and after that, start it! But I would like to improve this, I would like to implement datasource status condition, I mean, when datasource it become overloaded, it kill automatically , this way, I would not use crontab, but another kind of trigger |!
    Did you see this before ?
    I would like to improve this workaround !
    Just keep in mind, me and my team, didn´t discover the root cause yet, so, this automatically datasource restart is a kind of workaround!
    Thanks in advance !
    Edson

    Hmm. what was the problem app?
    Force a shut down by holding the power button for an extended amount.
    Reboot into SafeBoot mode to clear cache files, then reboot as normal.
    SafeBoot  http://support.apple.com/kb/HT1564

  • 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

Maybe you are looking for

  • Safari can't open a window

    Hi, I've updated iTunes, Safari and other updates, and than used the computer to set up iPad. Ever since, Safari won't open a window. I've tried removing any CT (toolbars) as indicated in other post but there aren't any. I've also tried configurating

  • Apple Tv -- Winston

    Sorry for the confusion....now it says    format not supported........  when this all started a week or two ago it said not authorized when I tried to play it from the Apple TV, but at least it was on the apple tv........since i reset the apple tv...

  • Printers deleting themselves from Windows 2008 R2 Print Server

    We have a server that is seemingly randomly deleting the print objects from the server itself. When we look at the Print server console, we see that all the installed/shared printers are "Error - Deleting". If we clear the jobs in the queue, the prin

  • How to use wwv_flow.g_inline_validation_error_cnt?

    well, I stucked... Somebody could post some sample code illustrating how to use g_inline_validation_error_cnt (number of validations errors). thx, cyryl

  • Spry accordion panel not lining up with top of viewport in FF3.5

    I have created a new web page using spry accordion for the first time on my site. In IE8 all works perfectly - opening and closing and moving between tabs is smoothly done. My first tab opens a very long panel (way over the web browser's height), and