I'm trying to write my first formula, for the Rserve package in R: https://www.rforge.net/Rserve/ .
So far I have this:
# Documentation: https://docs.brew.sh/Formula-Cookbook
# https://www.rubydoc.info/github/Homebrew/brew/master/Formula
class Rserve < Formula
desc "Rserve acts as a socket server (TCP/IP or local sockets) which allows binary requests to be sent to R."
homepage "http://www.rforge.net/Rserve/"
url "https://cran.r-project.org/src/contrib/Rserve_1.7-3.tar.gz"
sha256 "f6d636c736c3f16487d9987e54554fe0c55257b9bc0671b43e536d832e513027"
depends_on "r"
depends_on "gettext"
def install
system("whoami")
system("#{HOMEBREW_PREFIX}/bin/R CMD install --configure-args=\"CPPFLAGS=-L#{HOMEBREW_PREFIX}/opt/gettext/lib LDFLAGS=-I#{HOMEBREW_PREFIX}/opt/gettext/include\" .")
end
test do
# `test do` will create, run in and delete a temporary directory.
#
# This test will fail and we won't accept that! For Homebrew/homebrew-core
# this will need to be a test that verifies the functionality of the
# software. Run the test with `brew test Rserve`. Options passed
# to `brew install` such as `--HEAD` also need to be provided to `brew test`.
#
# The installed folder is not in the path, so use the entire path to any
# executables being tested: `system "#{bin}/program", "do", "something"`.
system "false"
end
end
The error I get is:
==> Downloading https://cran.r-project.org/src/contrib/Rserve_1.7-3.tar.gz
Already downloaded: /Users/kwilliams/Library/Caches/Homebrew/downloads/690e0934dcba3770ba80b743f7b2c9cee0250434ed17cc7949bc1eee74d5b170--Rserve_1.7-3.tar.gz
==> Verifying 690e0934dcba3770ba80b743f7b2c9cee0250434ed17cc7949bc1eee74d5b170--Rserve_1.7-3.tar.gz checksum
tar xf /Users/kwilliams/Library/Caches/Homebrew/downloads/690e0934dcba3770ba80b743f7b2c9cee0250434ed17cc7949bc1eee74d5b170--Rserve_1.7-3.tar.gz -C /private/tmp/d20190114-99089-11isfza
cp -pR /private/tmp/d20190114-99089-11isfza/Rserve/. /private/tmp/rserve-20190114-99089-b57ji6/Rserve
chmod -Rf +w /private/tmp/d20190114-99089-11isfza
==> whoami
kwilliams
==> /usr/local/bin/R CMD install --configure-args="CPPFLAGS=-L/usr/local/opt/gettext/lib LDFLAGS=-I/usr/local/opt/gettext/include" .
* installing to library ‘/usr/local/lib/R/3.5/site-library’
Error: ERROR: no permission to install to directory ‘/usr/local/lib/R/3.5/site-library’
==> Formula
Path: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/rserve.rb
==> Configuration
HOMEBREW_VERSION: 1.9.2-5-g44f4f36
ORIGIN: https://github.com/Homebrew/brew
HEAD: 44f4f36c0db693000410fe664b250a90325f4e32
Last commit: 4 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: de1ecc1d981de9d5165ea9e96242c32023d14d7c
Core tap last commit: 4 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_DEV_CMD_RUN: 1
HOMEBREW_ENABLE_AUTO_UPDATE_MIGRATION: 1
HOMEBREW_LOGS: /Users/kwilliams/Library/Logs/Homebrew
CPU: octa-core 64-bit kabylake
Homebrew Ruby: 2.3.7 => /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
Clang: 10.0 build 1000
Git: 2.17.2 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.54.0 => /usr/bin/curl
Java: 11.0.1, 1.8.0_192
macOS: 10.13.6-x86_64
CLT: 10.1.0.0.1.1539992718
Xcode: 10.1
XQuartz: 2.7.11 => /opt/X11
The permissions on /usr/local/lib/R/3.5/site-library should allow me to install there, though:
% ls -al /usr/local/lib/R/3.5/site-library
total 0
drwxr-xr-x 2 kwilliams admin 64 Jan 14 13:38 ./
drwxr-xr-x 3 kwilliams admin 96 Jan 14 13:38 ../
If I put myself in a directory where the Rserve tarball has been freshly expanded, then manually run the command /usr/local/bin/R CMD install --configure-args="CPPFLAGS=-L/usr/local/opt/gettext/lib LDFLAGS=-I/usr/local/opt/gettext/include" ., I don't get the error about "no permission to install to directory".
What's different about the environment that Homebrew is running that command, compared to me running it in a shell, that causes it to fail when run automatically?
My brew doctor output is clean, except for a warning that my docker keg is unlinked, which I assume is unrelated.
Figured it out - there's a sandbox (sandbox-exec, I think) in place that restricts writing to the filesystem outside the prefix directory:
https://discourse.brew.sh/t/potential-permission-issues-in-a-formula-im-writing/3707
I'll need to figure out the correct way to write files to /usr/local/lib/R/3.5/site-library, or symlink them to there from the Cellar directory, or whatever it is.
Related
On youtube there are many guides that show how to install openstack on ubuntu I have tried them and they seem not to work
For example with Devstack I fail every time the installation with .Stack.sh, with MicroStack I fail the initialization
I can't install OpenStack in any way!
could somebody help me?
I have installed openstack from various different ways but for me installing through Devstack is the easiest and the most convenient way to do it.
Let me share the installation steps that I use:
Firstly few prerequisites:
A fresh Ubuntu 20.04 installation (Ubuntu 18.04 Works)
8 GB RAM (4 GB RAM works)
4 vCPUs (2 vCPUs works)
Hard disk capacity of 20 GB (min 10 GB)
Step 1 : apt update -y && apt upgrade -y
Step 2: Create Stack user:
sudo adduser -s /bin/bash -d /opt/stack -m stack
echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack
su - stack
Step 3:
git clone https://git.openstack.org/openstack-dev/devstack
cd devstack
Step 4: Create devstack configuration file
vim local.conf
Paste this:
[[local|localrc]]
# Password for KeyStone, Database, RabbitMQ and Service
ADMIN_PASSWORD=admin
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
# Host IP - get your Server/VM IP address from ip addr command
HOST_IP=0.0.0.0
Step 5: ./stack.sh
The setup will take about 10-15 minutes depending upon your system. Once installation is complete you can access the dashboard using https://your-ip/dashboard
Note: Incase the stack.sh fails make sure to use ./unstack and ./clean.sh before you use stack.sh again.
I have a Mac, and install a Win10 VM by vmware fusion, the shared folders between Mac and Win10 VM use drive letter Z: or \vmware-host
And I mapped a network address \192.168.111.49\Builds to drive letter Y:
Then I install WSL2 in the Win10 VM, and linux subsystem Ubuntu 20.04 LTS
I want to mount all drive letter in Ubuntu, C: is automatically mount /mnt/c
And i use these cmd to mount Y:
sudo mkdir /mnt/y
sudo mount -t cifs -o username=xxx,password=xxxx,domain=xxx //192.168.111.49/Builds /mnt/y
It's OK
However, when I try mount Z:, it's not work
# from vmware official site
$ sudo vmhgfs-fuse -d .host:/ /mnt/z -o subtype=vmhgfs-fuse,allow_other
Segmentation fault (core dumped)
# try to use drvfs
$ sudo mount -t drvfs Z: /mnt/z
mount: /mnt/z: special device Z: does not exist.
<3>init: (457) ERROR: UtilCreateProcessAndWait:489: /bin/mount failed with status 0x2000
<3>init: (457) ERROR: MountPlan9:478: mount cache=mmap,rw,trans=fd,rfdno=3,wfdno=3,msize=65536,aname=drvfs;path=Z:;symlinkroot=/mnt/ failed 2
No such file or directory
# like network address
$ sudo mount -t cifs -o username=xxx,password=xxx //vmware-host/ /mnt/z
mount: /mnt/z: bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program.
And I check my open-vm-tools version
$ sudo apt-get upgrade open-vm-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
open-vm-tools is already the newest version (2:11.1.5-1~ubuntu20.04.2).
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
It's already newest.
Any help? Thanks.
I found the reason is I run cmd or powershell as administrator
If I don't use administator, the following mount is OK
sudo mount -t drvfs Z: /mnt/z
I'm using gitlab on a rasberry pi model 3 B. Following some information about my setup (sudo gitlab-rake gitlab:env:info):
System information
System: Raspbian 8.0
Current User: git
Using RVM: no
Ruby Version: 2.3.6p384
Gem Version: 2.6.13
Bundler Version:1.13.7
Rake Version: 12.3.0
Redis Version: 3.2.11
Git Version: 2.14.3
Sidekiq Version:5.0.5
Go Version: go1.3.3 linux/arm
GitLab information
Version: 10.6.0-rc3
Revision: 52fa89e
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL: http://gitlab.example.com
HTTP Clone URL: http://gitlab.example.com/some-group/some-project.git
SSH Clone URL: git#gitlab.example.com:some-group/some-project.git
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 6.0.3
Repository storage paths:
- default: /mnt/SeagateExpansion/GitLab/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks
Git: /opt/gitlab/embedded/bin/git
After the gitlab update to version 10.6.0 I need to change the url again but when I do the necessary changes in /etc/gitlab/gitlab.rb and run sudo nano gitlab-ctl reconfigure I get the following error messages:
========================================================================
Error executing action `run` on resource 'ruby_block[directory resource:
/mnt/SeagateExpansion/GitLab]'
========================================================================
and
============================================================================
Error executing action `create` on resource
'storage_directory[/mnt/SeagateExpansion/GitLab]'
============================================================================
The result message says:
There was an error running gitlab-ctl reconfigure:
storage_directory[/mnt/SeagateExpansion/GitLab] (gitlab::gitlab-rails line 42) had an error: Mixlib::ShellOut::ShellCommandFailed: ruby_block[directory resource: /mnt/SeagateExpansion/GitLab] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb line 33) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of chmod 00700 /mnt/SeagateExpansion/GitLab ----
STDOUT:
STDERR: chmod: changing permissions of ‘/mnt/SeagateExpansion/GitLab’: Operation not permitted
---- End output of chmod 00700 /mnt/SeagateExpansion/GitLab ----
Ran chmod 00700 /mnt/SeagateExpansion/GitLab returned 1
So the problem seems to be, that the execution of the run and create command on the resource storage (GitLab folder on the external HDD [HDD = SeagateExpansion]) expects the permissions to be 700, right?
According to this errors I tried to change the permission of
the external HDD folder /mnt/SeagateExpansion/GitLab see the ls -l output:
drwxrwxrwx 1 root GitLabUser 0 Jan 4 17:55 GitLab
With the help of this post I tried to change the permission with the command:
sudo find /mnt/SeagateExpansion/GitLab -type d -exec chmod 700 {} \;
to the required permission 700. But the changes don't take affect. I also tried chmod -R 700 /mnt/SeagateExpansion/GitLab and executed the commands as root but the changes don't take effect. Even after restarting the raspberry pi. What am I doing wrong?
I also tried to change the options settings/flag of the HDD in /etc/fstab to user but this doesn't help ether.
I'm thankful for every hint and answer :).
Best regards,
Bredjo
I finally figured it out. The solution is to change the mount settings in the /etc/fstab. Because if you have the wrong options settings (see: https://en.wikipedia.org/wiki/Fstab) you are not able to change the permissions because its a ntfs filesystem.
So my old fstab entry was this:
UUID=FE820568820526AD /mnt/SeagateExpansion ntfs defaults,gid=GitLabUser 0 0
And the new entry is this:
UUID=FE820568820526AD /mnt/SeagateExpansion ntfs-3g permissions 0 0
Note that you need to install ntfs-3g to use it in fstab. And the permissions options only comes with ntfs-3g. See: https://www.tuxera.com/community/ntfs-3g-advanced/ownership-and-permissions/
After this change I executed again:
sudo gitlab-ctl reconfigure
Now the error disappeared and the permission 700 of the folder /mnt/SeagateExpansion/GitLab could be set. I also noticed that the owner of the GitLab folder was also changed to user git after the reconfiguration:
drwx------ 1 git root 0 Jan 4 17:55 GitLab
That's because I don't need the option gid=GitLabUserany more.
Now everything works again :).
Is there a way around the following error when trying to install IJulia package in Windows 7 Enterprise?
julia> Pkg.add("IJulia")
INFO: Initializing package repository C:\Users\user01\.julia\v0.4
INFO: Cloning METADATA from git://github.com/JuliaLang/METADATA.jl
fatal: unable to connect to github.com:
github.com[0: 192.30.252.129]: errno=No error
ERROR: failed process: Process(`git clone -q -b metadata-v2
git://github.com/JuliaLang/METADATA.jl METADATA`, ProcessExited(128))
[128] in run at process.jl:531
Thanks
If I need to use a proxy, how do I specify that in the Julia console?
Finally found the solution on Google Groups.
Basically, (assuming you already have git installed) I had to run each of the following 3 lines from the Windows 7 Powershell:
git config --global url."https://github.com/".insteadOf git://github.com/
git config --global http.proxy http://<proxyuser>:<proxypwd>#proxy.server.com:8080
git config --global https.proxy http://<proxyuser>:<proxypwd>#proxy.server.com:8080
where: <proxyuser> is your username, <proxypwd> is your password, proxy.server.com is your proxy address, and 8080 is the proxy port.
Hope this helps.
While adding slaves to the quickstart VM provided by cloudera I am getting the following error. It looks like incompatible built error but I am not sure. If so, how can I resolve it. Any suggestion will be appreciated.
/tmp/scm_prepare_node.FmQxihPe
using SSH_CLIENT to get the SCM hostname: 10.0.96.100 49973 22
opening logging file descriptor
Starting installation script...
Acquiring installation lock...
BEGIN flock 4
END (0)
Detecting root privileges...
effective UID is 0
Detecting distribution...
BEGIN grep Tikanga /etc/redhat-release
END (1)
BEGIN grep 'CentOS release 5' /etc/redhat-release
END (1)
BEGIN grep 'Scientific Linux release 5' /etc/redhat-release
END (1)
BEGIN grep Santiago /etc/redhat-release
END (1)
BEGIN grep 'CentOS Linux release 6' /etc/redhat-release
END (1)
BEGIN grep 'CentOS release 6' /etc/redhat-release
END (0)
/etc/redhat-release ==> CentOS 6
Detecting Cloudera Manager Server...
CentOS release 6.6 (Final)
BEGIN host -t PTR 10.0.96.100
END (127)
/tmp/scm_prepare_node.FmQxihPe/scm_prepare_node.sh: line 105: host: command not found
BEGIN which python
END (0)
BEGIN python -c 'import socket; import sys; s = socket.socket(socket.AF_INET); s.settimeout(5.0); s.connect((sys.argv[1], int(sys.argv[2]))); s.close();' 10.0.96.100 7182
/usr/bin/python
END (0)
BEGIN which wget
END (1)
which: no wget in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin)
BEGIN wget -qO- -T 1 -t 1 http://169.254.169.254/latest/meta-data/public-hostname && /bin/echo
END (127)
/tmp/scm_prepare_node.FmQxihPe/scm_prepare_node.sh: line 105: wget: command not found
Installing package repositories...
validating format of repository file /tmp/scm_prepare_node.FmQxihPe/repos/rhel6/cloudera-manager.repo
installing repository file /tmp/scm_prepare_node.FmQxihPe/repos/rhel6/cloudera-manager.repo
repository file /tmp/scm_prepare_node.FmQxihPe/repos/rhel6/cloudera-manager.repo installed
Refreshing package metadata...
BEGIN yum clean all
Loaded plugins: fastestmirror
Cleaning repos: base cloudera-cdh5 cloudera-manager extras updates
Cleaning up Everything
END (0)
BEGIN rm -Rf /var/cache/yum/x86_64
END (0)
BEGIN yum makecache
Loaded plugins: fastestmirror
Metadata Cache Created
END (0)
Installing cloudera-manager-agent package...
BEGIN yum list installed cloudera-manager-agent
Loaded plugins: fastestmirror
Error: No matching Packages to list
END (1)
BEGIN yum info cloudera-manager-agent
Loaded plugins: fastestmirror
Determining fastest mirrors
* base: mirror.nexcess.net
* extras: mirror.thelinuxfix.com
* updates: mirror.us.leaseweb.net
Available Packages
Name : cloudera-manager-agent
Arch : x86_64
Version : 5.3.0
Release : 1.cm530.p0.166.el6
Size : 3.8 M
Repo : cloudera-manager
Summary : The Cloudera Manager Agent
URL : http://www.cloudera.com
License : Proprietary
Description : The Cloudera Manager Agent.
:
: The Agent is deployed to machines running services managed by
: Cloudera Manager.
END (0)
Version : 5.3.0
cloudera-manager-agent must have Version=5.3.0 and Build=155, exiting
closing logging file descriptor
So, after spending an entire day trying to solve this issue I was able to fix it. The issue is repo and parcels are not on the same page, one of them has older build than other which causes issue while updating. Manually updating the master node solved the issue for me. Follow this article to upgrade if you encounter similar issue:-
http://www.cloudera.com/content/cloudera/en/documentation/cloudera-manager/v5-0-0/Cloudera-Manager-Administration-Guide/cm5ag_upgrade_cm5.html?scroll=cmig_topic_9_4