Cannot change file to executable - android-source

I have the following file /data/MyExec/Exec.
I want to execute this file when the android device boots, therefore I created a service in init.rc that runs it.
The problem is that the file doesn't have execute permissions, so I also have to run chmod +x on the file before I execute it.
Because I run this file from init.rc I have to define { execute } in a policy file, and I did.
The problem is that I can't define both { setattr } and { execute } for the same file.
How then can I make it executable and run it on boot?
Thanks!

The solution was to place the exec in /bin/Exec. Files there are automatically executable and there's no need to change their mode.

Related

Cannot get .bat file to run after installation with Qt installer

I'm needing to run a bat file when the installer is finished that plugs in a postgres windows service so my database has an active server (I'm using a static postgres). The bat file runs the pg_ctl register command.
According to the Qt Installer Documentation installationFinished is what you use to issue methods that will run once the installer is complete via the controller or package install scripts. I'm not sure if i'm using it correctly because after running the installer the bat file doesnt run. How is this function used properly?
I have tried in the controller script:
Controller.prototype.installationFinished = function(){
installer.executeDetatched("C:\\Program Files (x86)\\PostgreSQL\\9.6\\pgserv.bat", new Array(), "#homeDir#")
}
also tried in the component install script:
Component.prototype.installationFinished = function(){
component.addElevatedOperation("Execute", "cmd", "/C", "C:\\Program Files (x86)\\PostgreSQL\\9.6\\pgserv.bat");
}
This bat file is to run post install because the command on the bat file requires the postgres\bin folder that is added to the PATH variable after install.
Thanks a lot for any help folks! :)
Try this one:
Component.prototype.installationFinished = function()
{
QDesktopServices.openUrl("file:///" + installer.value("TargetDir") +
"/file.bat");
}

"nohup ./filename.sh" not working in tSSH talend component

I'm using the tssh component to unzip a file, then delete the zip folder on a host which works fine.
The problem is when I try to run a .sh file in the same directory. In the commands for the tSSh component I have added the command
nohup filename.sh > outfile.out
in which case I get the error
no such file or directory
I have also tried
nohup ./filename.sh > outfile.out
but now the error is
./filename.sh command not found
All I need to do is execute the sh file.
Is your home directory the place where you expect to find the script filename.sh?
If yes, maybe you have a "cd" in your startup file.
If not, try to give 2 commands for nohup:
nohup `$(cd yourDirectoryPath ; ./filename.sh > outfile.out)
If you can't retrieve the result in outfile.out, check for nohup.out (and remove the redirection from the command line).
Hope this helps.
TRF

Accessing Homestead Globally

So I've installed Homestead and Laravel going through the steps in Laravel Documentation.
One problem that occured throughout the process, is that I can't set "homestead" command, to be accessible globally.
The Documentation writes, that I should just paste that line into the temrinal:
alias homestead='function __homestead() { (cd ~/Homestead && vagrant $*); unset -f __homestead; }; __homestead'
But that only makes it accessible globally untill I restart my terminal.
I've also edited my bash_profile file, adding
export PATH="/Users/MacbookPro/.composer/vendor/bin:$PATH"
to the very bottom of the file, but that does not work either.
To make your alias works every time you open terminal, you've to put your alias into .bashrc file so it been executed every time you open a new terminal tab.
Just add youralias to ~/.bashrc file
or
If you're using ohmyz.sh add youralias to ~/.zshrc file instead.

Run setup creation using bat - install4j

I run the command:
"C:\Program Files\install4j6\bin\install4jc.exe" --license="xxx" 64DeveloperInstallation.install4j -r RADview_Test.exe
(in the xxx i put a valid license)
and i got the response: Updated licensing information.
My Goal is to run the setup creation using Bat file.
You have to execute install4jc twice, once with
--license [license key]
and then with the other parameters for building your project.

lost PATH while trying to set custom winlogon shell in WindowsXP

I have changed the shell key in windows registry to gain custom shell (Kiosk usage):
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon]
I set shell key to a batch file which runs two applications as below:
start "myFirstAppTitle" "myAppPath\myApp1.exe"
start "mySecondAppTitle" "myAppPath\myApp2.exe"
Each application runs but the second application which needs some files to be excuted throws an error which says could not find dependency files. whereas the dependency files are adjoining to the exe file and the mentioned app works fine, when starts from startup.
Meanwhile when i run the batch file manually it rusn fine.
I added the PATH command to the batch file but it did't work too.
Change the batch file to this:
set PATH=%PATH%;C:\MyAppPath
start "myFirstAppTitle" "myApp1.exe"
start "mySecondAppTitle" "myApp2.exe"
If you start executables without an absolute path, the path is relative to the current working directory. Also, when you specify an executable with a relative path, %PATH% is not searched for a matching subfolder with a matching executable.
Since the script worked when you manually started it, your working directory probably was C:\. However, when run at logon as a replacement shell, the working directory is most likely "%SystemRoot%\system32".
The problem solved strangely, i removed the title parameter of start command and it worked. In fact i used start command this fashion:
set PATH=%PATH%;C:\MyAppPath
start myapp.exe
start myapp2.exe