Script to run on logout per user in mac/Mavericks - macos

I'm looking for a way to setup a list of script that run when I log out.
Basically, I want to write a server shutdown scripts for myself that will run automatically when a user log out or shut down per user logon. Able to start the server on logon via launchd. And how to shutdown server on logout.....
Env: Macbook pro 2010
OS version : OS X Version 10.9.2

Following link says that we cannot use logout script anymore :(
https://developer.apple.com/library/mac/documentation/macosx/conceptual/bpsystemstartup/chapters/CustomLogin.html

Related

Discover why GoDC won't start on Mac

I'm trying to run GoCD on MacOS (10.12) for testing purposes. When I run both the server and the client apps, they do not provide any GUI output (they should show progress bars or a host configuration) and they quit a couple of seconds after starting.
When I try to run the apps from Terminal as:
/Applications/Go\ Server.app/Contents/MacOS/go-server
I get the following output:
Got directory: /Users/taatyyu1/Library/Application Support/Go Server [It exists]
and then the app quits.
How can I discover what is the issue of the apps not starting properly?
The logs of the apps are available in
~/Library/Application\ Support/Go\ Server/osx-app.log
and
~/Library/Application\ Support/Go\ Agent/osx-app.log
They contain the information from apps starting up and you can use them to figure out what goes wrong

Windows Linux Subsystem: start Bash Application as a Service

As the title already summarizes:
How can I start a bash-script automatically, when the computer starts - ideally without the need to log in to windows - using the Microsoft Subsystem for Linux's Bash.
At the moment, this isn't supported, because the WSL session manager service will close after the last bash.exe wrapper instance closes. There are a few options, but the absolute simplest one at the moment is to use the run utility from the Xming developer and just add a shortcut to your startup folder (in the start menu) pointing to
run.exe bash.exe -c "/home/user/daemoninit.sh ; /bin/bash". Unfortunately, if your daemon initialization requires root access, for example, something like sshd, you will need to add an exception to sudoers that allows anybody to run the daemon with root privileges.
Also, there are problems getting it to run as a true Windows system service, since each lxss installation is user-specific. Some people have gotten it to run on system startup, but it launches in a separate Windows session for that user and makes it so you can't launch bash.exe in your current user session.

Trouble building build over Web interface

I set up a CI server for Xamarin.Forms using TeamCity on a mini Mac. When I run the build command from the terminal as root it builds successfully, but when I try to fire up a build from the Web UI it fails with the following error:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(0,0):
Tool exited with code: 1. Output: mdimport will not import on behalf
of root user. Exiting.
Amr, I cannot speak to Mac, but in Windows TC installs by default with the system account which would prevent any program/tools installed under a specific user account to run from TC Web UI. In Windows, I had to change the account for the service under which the teamcity server runs. I'm guessing you would have to do the same for Mac.
Stop the TC server service. Change the service user from system to your user. Start the TC server service.
this happens when you do:
sudo mdimport
but not:
mdimport
So, make sure that you currently own the current folder and you have read, write and execute permissions as well.
The solution is to install TeamCity in the recommended directory which is the /Library/TeamCity folder.

MPICH2 error - Credentials for <user> rejected connecting to <host> Aborting: Unable to connect to <host>

I need to get MPICH2 working for my college project. But it appears I won't implement anything until I manage how to start MPICH2. For now I only try to run anything on my computer, nothing more. What I do:
I install the MPICH2 (from mpich.org/downloads, from the bottom of the site - the x86_64 Windows version) on my 64bit Windows 7 (I also tried the same with my 64bit Windows 8). I start the installer from a command line (run as an administrator), install MPICH2 for everybody (although my acc is the only one). After successful installation I run the wmpiregister.exe, where I type Danioss (it's the name of my account) and the password for this account. I click register, everything seems to be fine so far. Then I run wmpiconfig.exe, I don't change nor click anything and there is this error:
'g-pc: MPICH2 not installed or unable to query the host'
I can see on the left the table with my host name (g-pc) and the version of MPICH - 1.4.1p1. So it sees it is installed here but cannot query the host. I have no idea what that means.
Of course I tried to execute any compiled program but after running wmpiexec.exe, choosing the file and clicking Execute - I get
'Credentials for Danioss rejected connecting to g-PC
Aborting: Unable to connect to g-PC'
I tried running every .exe as an administrator, didn't help. I also installed and reinstalled the whole MPICH2 tens of times (literally - tens) trying different configurations. I also tried to install the 32bit version but that made no progress. I really have no idea what the problem is.
Please, help me!
Greetings,
Daniel
Try not specifying username after running wmpiexec -register. Just password for your current user. That worked well for me. Source: https://trac.mpich.org/projects/mpich/ticket/1151
First: crate a windows user password of your windows user acount
Second: go to installdir deform (C:\Program Files\SFTC\DEFORM\v10.2\3D)
Third: execute "wmpiregister.exe" and register user name and password that your windows user name and password
start deform on multiprocessor
good work
You need to run wmpiregister.exe which is in bin folder, to register your Windows user.
Register using mpiexec -register with ".\" before the username, in your case: .\Danioss.

Issue with IOS Instruments running from command line on build machine

I've successfully run IOS UI Automation Instruments from command line on my local Mac. When it starts to test, the simulator will automatically pop up and then do the stuff.
However, when I SSH to a build server (with OSX and xcode, will use Jenkins eventually) and try to do the same thing, it doesn't work well.
Building process is fine, but as long as I run instruments, the terminal will then hang there without doing anything. I figure it has something to do with iphone simulator GUI but since it's CLI, I don't know what's going on...
Do you guys have any idea? Thanks!!
.
After executing the command from Jenkins through SSH; in most cases you would see a pop up window as in the screen shot. You will have to get past this screen to execute your tests. This post addresses how to get past that issue Stop "developer tools access needs to take control of another process for debugging to continue" alert
I've had the same issue. instruments -w "$DEVICE" were ignoring parameters.
Same with
DEVICE_TARGET='iPhone 6 (8.1 Simulator)' cucumber --format json -o test-reports/cucumber-8.1-iphone.json
It were ignoring DEVICE_TARGET parameter.
Solved via running Jenkins slave NOT as a SSH slave but as the Slave agent via java web start
http://i.stack.imgur.com/lNlPA.png
As i understand this issue is caused by OS X launchagent that managing sshd and performs scope of restrictions for remote users.
IMPORTANT! Slave agent should be started from OS X desktop, not via ssh! I've connected via VNC and launched slave java web agent on the OS X UI terminal.

Resources