installing trousers for tpm emulator - linux

I have installed tpm emulator successfully. I get this error
* Starting Trusted Computing daemon tcsd /etc/init.d/trousers: 32: [: /dev/tpm: unexpected operator [fail]
invoke-rc.d: initscript trousers, action "start" failed.
dpkg: error processing trousers (--configure):
subprocess installed post-installation script returned error exit status 2
E: Sub-process /usr/bin/dpkg returned an error code (1)
when executing
sudo apt-get install tpm-tools libtspi-dev

The answer to that particular error message is a broken line in the given script /etc/init.d/trousers.
The offending line 32:
31:
32: if [ ! -e /dev/tpm* ]
33: then
gets expanded to:
if [ ! -e /dev/tpm /dev/tpm0 ]
Which provokes an error. Changing that line to something like:
31:
32: if [ ! -e /dev/tpm ] && [ ! -e /dev/tpm0 ]
33: then
should at least make the script work.

Related

Why do i encounter an errror when I compile using make -j command in cygwin

I am trying to compile a software environment in Cygwin using make -j command and this error always shows up.
!error Hello World>
/bin/sh: -c: line 0: syntax error near unexpected token 'newline'
make: ***[makefile:404: ] Error 1

chef recipe - replace text in Linux file with sed command (receiving errors)

I am using the following code in a chef recipe:
bash 'replace_text' do
cwd ::File.dirname('/data01/nodemanager/bin')
code <<-EOH
sed 's/NODEMGR_HOME=.*/NODEMGR_HOME="\/data01\/nodemanager"/g' startNodeManager.sh
EOH
end
The text that I am trying to replace is everything on the line containing NODEMGR_HOME= startNodeManager.sh located at /data01/nodemanager/bin
and I am receiving the following output when running the recipe:
Running handlers:
[2017-11-21T23:58:22+00:00] ERROR: Running exception handlers
[2017-11-21T23:58:22+00:00] ERROR: Running exception handlers
Running handlers complete
[2017-11-21T23:58:22+00:00] ERROR: Exception handlers complete
[2017-11-21T23:58:22+00:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 01 seconds
[2017-11-21T23:58:22+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
[2017-11-21T23:58:22+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
[2017-11-21T23:58:22+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2017-11-21T23:58:22+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2017-11-21T23:58:22+00:00] ERROR: bash[replace_text] (domain-test::sed2 line 1) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of "bash" "/tmp/chef-script20171121-11258-vwwwm6" ----
STDOUT:
STDERR: sed: -e expression #1, char 34: unknown option to `s'
---- End output of "bash" "/tmp/chef-script20171121-11258-vwwwm6" ----
Ran "bash" "/tmp/chef-script20171121-11258-vwwwm6" returned 1
[2017-11-21T23:58:22+00:00] ERROR: bash[replace_text] (domain-test::sed2 line 1) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of "bash" "/tmp/chef-script20171121-11258-vwwwm6" ----
STDOUT:
STDERR: sed: -e expression #1, char 34: unknown option to `s'
---- End output of "bash" "/tmp/chef-script20171121-11258-vwwwm6" ----
Ran "bash" "/tmp/chef-script20171121-11258-vwwwm6" returned 1
[2017-11-21T23:58:22+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
[2017-11-21T23:58:22+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>> Converge failed on instance <default-ubuntu-1404>. Please see .kitchen/logs/default-ubuntu-1404.log for more details
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
You don't have enough levels of escaping on your backslashes. Remember it's a Ruby string first, then a bash string, then a sed argument. Also you can sidestep this whole issue by using the line or poise-file cookbooks instead.

Cannot install gitlab using omnibus: Error executing action `run` on resource 'bash[migrate gitlab-rails database]'

I've installed gitlab before and it was a pretty straight forward process, for the past week however the process outlines on the website fails at the sudo EXTERNAL_URL="http://gitlab.example.com" apt-get install gitlab-ee step.
The error seen:
================================================================================
Error executing action `run` on resource 'bash[migrate gitlab-rails database]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of "bash" "/tmp/chef-script20171024-7894-1sl10lo" ----
STDOUT: rake aborted!
PG::ConnectionBad: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/opt/gitlab/postgresql/.s.PGSQL.5432"?
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:49:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => gitlab:db:configure
(See full trace by running task with --trace)
STDERR:
---- End output of "bash" "/tmp/chef-script20171024-7894-1sl10lo" ----
Ran "bash" "/tmp/chef-script20171024-7894-1sl10lo" returned 1
Resource Declaration:
---------------------
# In /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/database_migrations.rb
51: bash "migrate gitlab-rails database" do
52: code <<-EOH
53: set -e
54: log_file="#{node['gitlab']['gitlab-rails']['log_directory']}/gitlab-rails-db-migrate-$(date +%Y-%m-%d-%H-%M-%S).log"
55: umask 077
56: /opt/gitlab/bin/gitlab-rake gitlab:db:configure 2>& 1 | tee ${log_file}
57: STATUS=${PIPESTATUS[0]}
58: echo $STATUS > #{db_migrate_status_file}
59: exit $STATUS
60: EOH
61: environment env_variables unless env_variables.empty?
62: notifies :run, 'execute[enable pg_trgm extension]', :before if omnibus_helper.service_enabled?('postgresql')
63: notifies :run, "execute[clear the gitlab-rails cache]", :immediately
64: dependent_services.each do |svc|
65: notifies :restart, svc, :immediately
66: end
67: not_if "(test -f #{db_migrate_status_file}) && (cat #{db_migrate_status_file} | grep -Fx 0)"
68: only_if { node['gitlab']['gitlab-rails']['auto_migrate'] }
69: end
Compiled Resource:
------------------
# Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/database_migrations.rb:51:in `from_file'
bash("migrate gitlab-rails database") do
action [:run]
updated true
retries 0
retry_delay 2
default_guard_interpreter :default
command "migrate gitlab-rails database"
backup 5
returns 0
code " set -e\n log_file=\"/var/log/gitlab/gitlab-rails/gitlab-rails-db-migrate-$(date +%Y-%m-%d-%H-%M-%S).log\"\n umask 077\n /opt/gitlab/bin/gitlab-rake gitlab:db:configure 2>& 1 | tee ${log_file}\n STATUS=${PIPESTATUS[0]}\n echo $STATUS > /var/opt/gitlab/gitlab-rails/upgrade-status/db-migrate-873248b1f0d3a7a5535771a3a1635803-3a712c3\n exit $STATUS\n"
interpreter "bash"
declared_type :bash
cookbook_name "gitlab"
recipe_name "database_migrations"
not_if "(test -f /var/opt/gitlab/gitlab-rails/upgrade-status/db-migrate-873248b1f0d3a7a5535771a3a1635803-3a712c3) && (cat /var/opt/gitlab/gitlab-rails/upgrade-status/db-migrate-873248b1f0d3a7a5535771a3a1635803-3a712c3 | grep -Fx 0)"
only_if { #code block }
end
Platform:
---------
x86_64-linux
Running handlers:
Running handlers complete
Chef Client failed. 5 resources updated in 45 seconds
dpkg: error processing package gitlab-ee (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
gitlab-ee
E: Sub-process /usr/bin/dpkg returned an error code (1)
This is on Ubuntu 16.04LTS. How to resolve this and install gitlab?
I've also tried using older ways of installing gitlab (where gitlab was first installed then configured) however it still failed at the sudo gitlab-ctl reconfigure step.
Commonly the signal 137 indicate out of memory, check your system log:
grep -i memory /var/log/messages
dd if=/dev/zero of=/swap bs=1M count=1024
mkswap /swap
swapon /swap

etc/init.d/vncserver: line 33: [: =: unary operator expected

While starting and stopping the vncserver . i am facing the following error.But, the service is running fine.SO do any one have the similar kind of error on vnc server startup script.
"
/etc/init.d/vncserver restart
Shutting down VNC server: 9:shashikanth.bussa
/etc/init.d/vncserver: line 33: [: =: unary operator expected
start() {
[ "$EUID" != "0" ] && exit 4
# Source networking configuration.
. /etc/sysconfig/network
"
Its because of /etc/sysconfig/network file entry.
We need to make sure the option NETWORKING=yes.
Then restart the vnc service.

RISCV testing emulator

When I'm trying to run riscv emulator asm tests I faced with below error:
./emulator-DefaultCPPConfig +dramsim +max-cycles=100000000 +verbose +loadmem=output/rv64ui-p-amoand_d.hex none 2> output/rv64ui-p-amoand_d.out && [ $PIPESTATUS -eq 0 ]
/bin/sh: 1: [: -eq: unexpected operator
make: *** [output/rv64ui-p-amoand_d.out] Error 2
I followed your instruction in your git. It can build emulator without any error, but problem happens when it's trying to run tests.
I added bash behind of the command in the makefile and the first error solved but when I did that I got a new error:
bash ./emulator-DefaultCPPConfig +dramsim +max-cycles=100000000 +verbose +loadmem=output/rv64ui-p-amoswap_d.hex none 2> output/rv64ui-p-amoswap_d.out && [ $PIPESTATUS -eq 0 ]
make: *** [output/rv64ui-p-amoswap_d.out] Error 126
The problem is from Shell variable, I just needed to add following line to Makefile:
SHELL=/bin/bash
It would solve the problem.

Resources