I am using mac and I am trying to change my open file limit by modifying the following directory:
/Library/LaunchDaemons
when I created two files I got the following permissions:
-rw-r--r--# 1 root wheel 535 Jul 2 16:36 limit.maxfiles.plist
-rw-r--r--# 1 samu wheel 586 Jul 2 16:53 limit.maxproc.plist
however when I run limit.maxproc.plist file I get the following error:
/Library/LaunchDaemons/limit.maxproc.plist: Path had bad ownership/permissions
which is due to the permissions of my group.
I want to change the group from samu to root but not sure how?
I found the solution. To change a specific file owner to root you can use the following command :
sudo chown root limit.maxproc.plist
Related
Elasticsearch Cluster Setup doubt:
Where to place unicast_hosts.txt file for cluster setup in ES 6.5?
In elasticsearch website (6.5) it is mentioned to put the unicast_hosts.txt file in below directory:
$ES_PATH_CONF/discovery-file/unicast_hosts.txt
I have installed ES 6.5
[root#xxxx discovery-file]# pwd
/usr/share/elasticsearch/plugins/discovery-file
[root#xxxx discovery-file]# ls -ltr
-rw-r--r--. 1 root root 1503 May 20 16:21 plugin-descriptor.properties
-rw-r--r--. 1 root root 152 May 20 16:21 NOTICE.txt
-rw-r--r--. 1 root root 6368 May 20 16:21 discovery-file-6.5.4.jar
-rw-r--r--. 1 root root 11358 May 20 16:21 LICENSE.txt
Now do I need to put the unicast_hosts.txt inside discovery-file-6.5.4.jar or just in this directory.
Please suggest!
Here is the answer I provided on discuss:
It should be in the elasticsearch config dir. The same directory as you have elasticsearch.yml.
So if your config dir is: /foo, then place this file under /foo/discovery-file/unicast_hosts.txt.
Depending on how you installed elasticsearch, it might be in /etc/elasticsearch/discovery-file/unicast_hosts.txt.
Note that you need to also add the following to your elasticsearch.yml file:
discovery.zen.hosts_provider: file
I'm unable to Build/Archive my project due to an error:
Permission denied
Command PhaseScriptExecution failed with a nonzero exit code
I have tried correcting keychain login as advised by other answers, but it hasn't worked. Please could someone help? Most likely a rookie mistake but means I cannot even simulate my app.
Further details on the error:
PhaseScriptExecution Copy\ Pods\ Resources
/Users/james/Library/Developer/Xcode/DerivedData/trials-fseuxkwjlleukxdxyfgdrujhdwuy/Build/Intermediates.noindex/trials.build/Debug-iphonesimulator/trials.build/Script-8DEE2FC97BFA0D6E636019C4.sh (in target: trials)
cd /Users/james/pCloud\ Drive/3.\ NeuroRecovery\ Ltd/4.\ Products/3.\ NIHR\ Trial\ NHS/v1.0\ -\ Initial\ App/1.\ App\ Delivery/3.\ Source\ Code/1.\ iOS/trials
/bin/sh -c /Users/james/Library/Developer/Xcode/DerivedData/trials-fseuxkwjlleukxdxyfgdrujhdwuy/Build/Intermediates.noindex/trials.build/Debug-iphonesimulator/trials.build/Script-8DEE2FC97BFA0D6E636019C4.sh
/Users/james/Library/Developer/Xcode/DerivedData/trials-fseuxkwjlleukxdxyfgdrujhdwuy/Build/Intermediates.noindex/trials.build/Debug-iphonesimulator/trials.build/Script-8DEE2FC97BFA0D6E636019C4.sh: line 2: /Users/james/pCloud Drive/3. NeuroRecovery Ltd/4. Products/3. NIHR Trial NHS/v1.0 - Initial App/1. App Delivery/3. Source Code/1. iOS/trials/Pods/Target Support Files/Pods-trials/Pods-trials-resources.sh: Permission denied
Command PhaseScriptExecution failed with a nonzero exit code
Edit 17th Dec:
thank you #geno-chen & #fantini I have checked & can report the following:
Did you install Cocoapods with sudo: Yes.
I checked the permissions of the files using ls -lh and had the following:
-rw-r--r-- 1 james staff 159B 25 Mar 2015 Podfile
-rw-r--r-- 1 james staff 1.2K 25 Mar 2015 Podfile.lock
drwxr-xr-x 11 james staff 352B 17 Dec 14:03 Pods
drwxr-xr-x 52 james staff 1.6K 17 Dec 14:03 trials
drwxr-xr-x# 5 james staff 160B 17 Dec 14:03 trials.xcodeproj
drwxr-xr-x# 5 james staff 160B 17 Dec 14:03 trials.xcworkspace
drwxr-xr-x 4 james staff 128B 17 Dec 14:03 trialsTests
I used chmod to modify permissions of the podfiles as below:
-rwxr-xr-x 1 james staff 159B 25 Mar 2015 Podfile
-rwxr-xr-x 1 james staff 1.2K 25 Mar 2015 Podfile.lock
drwxr-xr-x 11 james staff 352B 17 Dec 14:03 Pods
drwxr-xr-x 52 james staff 1.6K 17 Dec 14:03 trials
drwxr-xr-x# 5 james staff 160B 17 Dec 14:03 trials.xcodeproj
drwxr-xr-x# 5 james staff 160B 17 Dec 14:03 trials.xcworkspace
drwxr-xr-x 4 james staff 128B 17 Dec 14:03 trialsTests
I then Cleaned my Build Folder, restarted but still have the same error.
I fixed the permission problem by running the following command.
chmod +x "Path to .sh"
Please replace ProjectName with your project name and username with your username
chmod +x /Users/username/Documents/ProjectName/Pods/Target\ Support\ Files/Pods-ProjectName/Pods-ProjectName-frameworks.sh
You can get the path from your xcode project as explained by step 1 to 3
I've tried #Sawsan method but get no luck even the file is already executable.
Here is the step how I solve it:
1.delete Podfile.lock
2.delete Pods directory
3.delete .xcworkspace file
4.Pod install again
that's it.
give it a try!
I have to own a trial for this solution and I got a proper result.
Follow the step:
1) Open Terminal and set a project path
"pod deintegrate" command executes
2) Then after "pod install" command executes.
I solved by deleting the Pods folder that was committed to the repo.
Any custom metasploit module I create isn't getting loaded.
I tried both of these demos:
https://www.offensive-security.com/metasploit-unleashed/building-module/ https://github.com/rapid7/metasploit-framework/wiki/Loading-External-Modules
and got the same result that the modules were NOT found.
Before posting here, I checked these out:
https://forums.kali.org/showthread.php?28940-Metasploit-modules-not-loading!
https://www.offensive-security.com/metasploit-unleashed/modules-and-locations
and from SO:
I can't get new modules to load in metasploit
How to add module in Metasploit?
no help
Just working with the github example, on the Kali host, I do indeed have the file in the right location (according to the demo):
root#kali:~/.msf4/modules/exploits/test# ls -al
total 12
drwxr-xr-x 2 root root 4096 Mar 19 13:59 .
drwxr-xr-x 3 root root 4096 Mar 19 13:58 ..
-rw-r--r-- 1 root root 9 Mar 19 13:59 test_module.rb
I then ran reload_all and when using this command:
use exploit/test/test_module it returns with Failed to load module.
I also tried to manually load that path and it failed too:
msf > loadpath ~/.msf4/modules/
Loaded 0 modules:
Posting the answer for anyone who may come across this. I'm kinda new to this; didn't know where metasploit info gets logged.
It's in: ~/.msf4/logs/framework.log
The log told me I had a syntax error... must have happened from copying and pasting the text from the browser. Cleaned that up and everything works.
I stuck with this problem in my project, so, I tried it with an empty test project. Here is what I do.
Create a new Cocoa application project in Xcode.
Add a new command-line tool target to it.
Add this target to the dependencies of the cocoa app.
In cocoa app target build phases add Copy files build phase, Destination = Executables, add executable product to the list.
Now Run cocoa application. No problem, application launched. Navigate app bundle in Finder, Show package contents, executable here in Contents/MacOS. This is what I expect to be.
The problem occurs when I archive cocoa application, it fails with the following error:
(null): error: /Users/prudnikov/Library/Developer/Xcode/DerivedData/TestAppWithExecutable-hiysgipuqcktgoayxrgjfrtcxubl/Build/Intermediates/ArchiveIntermediates/TestAppWithExecutable/BuildProductsPath/Release/TestAppExecutable: No such file or directory
Here is a screenshot
Here is content of this directory
prudnikov#Vladimirs-iMac ~ $ ls -al /Users/prudnikov/Library/Developer/Xcode/DerivedData/TestAppWithExecutable-hiysgipuqcktgoayxrgjfrtcxubl/Build/Intermediates/ArchiveIntermediates/TestAppWithExecutable/BuildProductsPath/Release/
total 8
drwxr-xr-x 5 prudnikov staff 170B Apr 26 21:59 ./
drwxr-xr-x# 3 prudnikov staff 102B Apr 26 21:59 ../
drwxr-xr-x 3 prudnikov staff 102B Apr 26 21:59 TestAppExecutable.dSYM/
lrwxr-xr-x 1 prudnikov staff 239B Apr 26 21:59 TestAppWithExecutable.app# -> /Users/prudnikov/Library/Developer/Xcode/DerivedData/TestAppWithExecutable-hiysgipuqcktgoayxrgjfrtcxubl/Build/Intermediates/ArchiveIntermediates/TestAppWithExecutable/InstallationBuildProductsLocation/Applications/TestAppWithExecutable.app
drwxr-xr-x 3 prudnikov staff 102B Apr 26 21:59 TestAppWithExecutable.app.dSYM/
Archiving executable — no problems. All build settings are defaults.
I've also tried to change build configuration from Debug to Release for Run action of Cocoa application scheme. It runs successfully in this case as well.
This is very strange for me. Please advice how to do it?
UPDATE: It seems that I have problem with OS. People tried the same example and it worked. Then I trien to create a new account on my Mac and do the same there and it worked as well. What global configuration can cause this?
I don't think this is an Answer but it's too long for a comment.
Check the parent directories
gdunham: ~/Library/Developer/Xcode/DerivedData$ ls -laeG /Users/gdunham/Library/Developer/Xcode/DerivedData | grep -e " \\.$"
drwxr-xr-x 31 gdunham staff 1054 Apr 15 14:29 /Users/gdunham/Library/Developer/Xcode/DerivedData
drwxr-xr-x 13 gdunham staff 442 May 1 19:56 /Users/gdunham/Library/Developer/Xcode
drwxr-xr-x 4 gdunham staff 136 Mar 8 2012 /Users/gdunham/Library/Developer/
drwx------# 66 gdunham staff 2244 Apr 2 22:43 /Users/gdunham/Library
0: group:everyone deny delete
drwxr-xr-x+ 62 gdunham staff 2108 Apr 30 14:33 /Users/gdunham
0: group:everyone deny delete
drwxr-xr-x 7 root admin 238 Feb 20 14:16 /Users
drwxr-xr-x 34 root wheel 1224 Apr 20 09:26 /
Also look at your group membership
gdunham: ~/Library/Developer/Xcode/DerivedData$ groups
staff com.apple.access_screensharing com.apple.access_screensharing-disabled everyone _appstore localaccounts _appserverusr admin _appserveradm _lpadmin _lpoperator _developer com.apple.sharepoint.group.1
"The application has exited during startup (i.e. during the evaluation of config/environment.rb). The error message may have been written to the web server's log file. Please check the web server's log file (i.e. not the (Rails) application's log file) to find out why the application exited."
I'm getting the above error message when I try to access my test site.
Permission for config/* is
-rw-r--r-- 1 www-data root 2011 Aug 27 20:17 environment.rb
drwxr-xr-x 3 root root 4096 Aug 27 20:17 environments
drwxr-xr-x 3 root root 4096 Aug 27 20:17 initializers
drwxr-xr-x 3 root root 4096 Aug 27 20:17 locales
-rw-r--r-- 1 root root 2431 Aug 27 20:17 routes.rb
I've tried "root root 2011 Aug 27 20:17 environment.rb" as well but no success either.
I'm running Debian GNU/Linux and have other Rails sites running fine on the same server, I have tried to replicate the setup from one of the other sites, but it's not having any effect.
I encountered this same issue, and after killing passenger and apache ended up finding:
http://geminstallthat.wordpress.com/2009/03/01/passenger-with-rails-23-application-missingsourcefile/
Essentially the issue is for some versions of libapache2-mod-passenger the app/controllers/application.rb change to app/controllers/application_controller.rb (in Rails 2.3) explodes things (technical term).