Error after installing Gitlab on ubuntu 18.04 - linux

i want to install gitlab on ubuntu 18.04 but :-( !.
sudo apt-get install -y curl openssh-server ca-certificates
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash
sudo EXTERNAL_URL="http://gitlab.example.com" apt-get install gitlab-ee
any solution ?
if someone already solve the same problem or something similar, thanks in advance ;-)
result :
Recipe: postgresql::enable
* directory[/var/opt/gitlab/postgresql] action create
- create new directory /var/opt/gitlab/postgresql
- change mode from '' to '0755'
- change owner from '' to 'gitlab-psql'
* directory[/var/opt/gitlab/postgresql] action create (up to date)
* directory[/var/opt/gitlab/postgresql/data] action create
- create new directory /var/opt/gitlab/postgresql/data
- change mode from '' to '0700'
- change owner from '' to 'gitlab-psql'
* directory[/var/log/gitlab/postgresql] action create
- create new directory /var/log/gitlab/postgresql
- change mode from '' to '0700'
- change owner from '' to 'gitlab-psql'
* link[/var/opt/gitlab/postgresql/data] action create (skipped due to not_if)
* file[/var/opt/gitlab/postgresql/.profile] action create
- create new file /var/opt/gitlab/postgresql/.profile
- update content in file /var/opt/gitlab/postgresql/.profile from none to 3b0387
--- /var/opt/gitlab/postgresql/.profile 2019-12-13 02:51:57.452326848 +0100
+++ /var/opt/gitlab/postgresql/.chef-.profile20191213-11373-1qqmckf.profile 2019-12-13 02:51:57.448326813 +0100
## -1 +1,2 ##
+PATH=/opt/gitlab/embedded/bin:/opt/gitlab/bin:$PATH
- change mode from '' to '0600'
- change owner from '' to 'gitlab-psql'
* gitlab_sysctl[kernel.shmmax] action create
* directory[create /etc/sysctl.d for kernel.shmmax] action create (up to date)
* file[create /opt/gitlab/embedded/etc/90-omnibus-gitlab-kernel.shmmax.conf kernel.shmmax] action create
- create new file /opt/gitlab/embedded/etc/90-omnibus-gitlab-kernel.shmmax.conf
- update content in file /opt/gitlab/embedded/etc/90-omnibus-gitlab-kernel.shmmax.conf from none to 75a195
--- /opt/gitlab/embedded/etc/90-omnibus-gitlab-kernel.shmmax.conf 2019-12-13 02:51:57.464326950 +0100
+++ /opt/gitlab/embedded/etc/.chef-90-omnibus-gitlab-kernel20191213-11373-zkx5md.shmmax.conf 2019-12-13 02:51:57.464326950 +0100
## -1 +1,2 ##
+kernel.shmmax = 17179869184
* execute[load sysctl conf kernel.shmmax] action run
[execute] * Applying /etc/sysctl.d/10-console-messages.conf ...
kernel.printk = 4 4 1 7
* Applying /etc/sysctl.d/10-ipv6-privacy.conf ...
net.ipv6.conf.all.use_tempaddr = 2
net.ipv6.conf.default.use_tempaddr = 2
* Applying /etc/sysctl.d/10-kernel-hardening.conf ...
kernel.kptr_restrict = 1
* Applying /etc/sysctl.d/10-link-restrictions.conf ...
fs.protected_hardlinks = 1
fs.protected_symlinks = 1
* Applying /etc/sysctl.d/10-magic-sysrq.conf ...
kernel.sysrq = 176
* Applying /etc/sysctl.d/10-network-security.conf ...
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.tcp_syncookies = 1
* Applying /etc/sysctl.d/10-ptrace.conf ...
kernel.yama.ptrace_scope = 1
* Applying /etc/sysctl.d/10-zeropage.conf ...
vm.mmap_min_addr = 65536
* Applying /usr/lib/sysctl.d/50-default.conf ...
net.ipv4.conf.all.promote_secondaries = 1
net.core.default_qdisc = fq_codel
* Applying /etc/sysctl.d/90-omnibus-gitlab-kernel.sem.conf ...
sysctl: cannot open "/etc/sysctl.d/90-omnibus-gitlab-kernel.sem.conf": No such file or directory
* Applying /etc/sysctl.d/90-omnibus-gitlab-kernel.shmall.conf ...
sysctl: cannot open "/etc/sysctl.d/90-omnibus-gitlab-kernel.shmall.conf": No such file or directory
* Applying /etc/sysctl.d/90-omnibus-gitlab-kernel.shmmax.conf ...
kernel.shmmax = 17179869184
* Applying /etc/sysctl.d/90-omnibus-gitlab-net.core.somaxconn.conf ...
sysctl: cannot open "/etc/sysctl.d/90-omnibus-gitlab-net.core.somaxconn.conf": No such file or directory
* Applying /etc/sysctl.d/99-sysctl.conf ...
* Applying /etc/sysctl.conf ...
================================================================================
Error executing action `run` on resource 'execute[load sysctl conf kernel.shmmax]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '255'
---- Begin output of sysctl -e --system ----
STDOUT: * Applying /etc/sysctl.d/10-console-messages.conf ...
kernel.printk = 4 4 1 7
* Applying /etc/sysctl.d/10-ipv6-privacy.conf ...
net.ipv6.conf.all.use_tempaddr = 2
net.ipv6.conf.default.use_tempaddr = 2
* Applying /etc/sysctl.d/10-kernel-hardening.conf ...
kernel.kptr_restrict = 1
* Applying /etc/sysctl.d/10-link-restrictions.conf ...
fs.protected_hardlinks = 1
fs.protected_symlinks = 1
* Applying /etc/sysctl.d/10-magic-sysrq.conf ...
kernel.sysrq = 176
* Applying /etc/sysctl.d/10-network-security.conf ...
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.tcp_syncookies = 1
* Applying /etc/sysctl.d/10-ptrace.conf ...
kernel.yama.ptrace_scope = 1
* Applying /etc/sysctl.d/10-zeropage.conf ...
vm.mmap_min_addr = 65536
* Applying /usr/lib/sysctl.d/50-default.conf ...
net.ipv4.conf.all.promote_secondaries = 1
net.core.default_qdisc = fq_codel
* Applying /etc/sysctl.d/90-omnibus-gitlab-kernel.sem.conf ...
* Applying /etc/sysctl.d/90-omnibus-gitlab-kernel.shmall.conf ...
* Applying /etc/sysctl.d/90-omnibus-gitlab-kernel.shmmax.conf ...
kernel.shmmax = 17179869184
* Applying /etc/sysctl.d/90-omnibus-gitlab-net.core.somaxconn.conf ...
* Applying /etc/sysctl.d/99-sysctl.conf ...
* Applying /etc/sysctl.conf ...
STDERR: sysctl: cannot open "/etc/sysctl.d/90-omnibus-gitlab-kernel.sem.conf": No such file or directory
sysctl: cannot open "/etc/sysctl.d/90-omnibus-gitlab-kernel.shmall.conf": No such file or directory
sysctl: cannot open "/etc/sysctl.d/90-omnibus-gitlab-net.core.somaxconn.conf": No such file or directory
---- End output of sysctl -e --system ----
Ran sysctl -e --system returned 255
Resource Declaration:
---------------------
# In /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/gitlab_sysctl.rb
46: execute "load sysctl conf #{new_resource.name}" do
47: command "sysctl -e --system"
48: action :nothing
49: end
50: end
Compiled Resource:
------------------
# Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/gitlab_sysctl.rb:46:in `block in class_from_file'
execute("load sysctl conf kernel.shmmax") do
action [:nothing]
default_guard_interpreter :execute
command "sysctl -e --system"
backup 5
declared_type :execute
cookbook_name "postgresql"
domain nil
user nil
end
System Info:
------------
chef_version=14.13.11
platform=ubuntu
platform_version=18.04
ruby=ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]
program_name=/opt/gitlab/embedded/bin/chef-client
executable=/opt/gitlab/embedded/bin/chef-client
================================================================================
Error executing action `create` on resource 'gitlab_sysctl[kernel.shmmax]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
execute[load sysctl conf kernel.shmmax] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/gitlab_sysctl.rb line 46) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '255'
---- Begin output of sysctl -e --system ----
STDOUT: * Applying /etc/sysctl.d/10-console-messages.conf ...
kernel.printk = 4 4 1 7
* Applying /etc/sysctl.d/10-ipv6-privacy.conf ...
net.ipv6.conf.all.use_tempaddr = 2
net.ipv6.conf.default.use_tempaddr = 2
* Applying /etc/sysctl.d/10-kernel-hardening.conf ...
kernel.kptr_restrict = 1
* Applying /etc/sysctl.d/10-link-restrictions.conf ...
fs.protected_hardlinks = 1
fs.protected_symlinks = 1
* Applying /etc/sysctl.d/10-magic-sysrq.conf ...
kernel.sysrq = 176
* Applying /etc/sysctl.d/10-network-security.conf ...
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.tcp_syncookies = 1
* Applying /etc/sysctl.d/10-ptrace.conf ...
kernel.yama.ptrace_scope = 1
* Applying /etc/sysctl.d/10-zeropage.conf ...
vm.mmap_min_addr = 65536
* Applying /usr/lib/sysctl.d/50-default.conf ...
net.ipv4.conf.all.promote_secondaries = 1
net.core.default_qdisc = fq_codel
* Applying /etc/sysctl.d/90-omnibus-gitlab-kernel.sem.conf ...
* Applying /etc/sysctl.d/90-omnibus-gitlab-kernel.shmall.conf ...
* Applying /etc/sysctl.d/90-omnibus-gitlab-kernel.shmmax.conf ...
kernel.shmmax = 17179869184
* Applying /etc/sysctl.d/90-omnibus-gitlab-net.core.somaxconn.conf ...
* Applying /etc/sysctl.d/99-sysctl.conf ...
* Applying /etc/sysctl.conf ...
STDERR: sysctl: cannot open "/etc/sysctl.d/90-omnibus-gitlab-kernel.sem.conf": No such file or directory
sysctl: cannot open "/etc/sysctl.d/90-omnibus-gitlab-kernel.shmall.conf": No such file or directory
sysctl: cannot open "/etc/sysctl.d/90-omnibus-gitlab-net.core.somaxconn.conf": No such file or directory
---- End output of sysctl -e --system ----
Ran sysctl -e --system returned 255
Resource Declaration:
---------------------
# In /opt/gitlab/embedded/cookbooks/cache/cookbooks/postgresql/recipes/enable.rb
67: gitlab_sysctl "kernel.shmmax" do
68: value node['postgresql']['shmmax']
69: end
70:
Compiled Resource:
------------------
# Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/postgresql/recipes/enable.rb:67:in `from_file'
gitlab_sysctl("kernel.shmmax") do
action [:create]
updated true
updated_by_last_action true
default_guard_interpreter :default
declared_type :gitlab_sysctl
cookbook_name "postgresql"
recipe_name "enable"
value 17179869184
end
System Info:
------------
chef_version=14.13.11
platform=ubuntu
platform_version=18.04
ruby=ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]
program_name=/opt/gitlab/embedded/bin/chef-client
executable=/opt/gitlab/embedded/bin/chef-client
Recipe: gitlab::gitlab-rails
* execute[clear the gitlab-rails cache] action run
- execute /opt/gitlab/bin/gitlab-rake cache:clear
Recipe:
* service[gitaly] action restart
- restart service service[gitaly]
Recipe: gitaly::enable
* runit_service[gitaly] action hup
- send hup to runit_service[gitaly]
Running handlers:
There was an error running gitlab-ctl reconfigure:
gitlab_sysctl[kernel.shmmax] (postgresql::enable line 67) had an error: Mixlib::ShellOut::ShellCommandFailed: execute[load sysctl conf kernel.shmmax] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/gitlab_sysctl.rb line 46) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '255'
---- Begin output of sysctl -e --system ----
STDOUT: * Applying /etc/sysctl.d/10-console-messages.conf ...
kernel.printk = 4 4 1 7
* Applying /etc/sysctl.d/10-ipv6-privacy.conf ...
net.ipv6.conf.all.use_tempaddr = 2
net.ipv6.conf.default.use_tempaddr = 2
* Applying /etc/sysctl.d/10-kernel-hardening.conf ...
kernel.kptr_restrict = 1
* Applying /etc/sysctl.d/10-link-restrictions.conf ...
fs.protected_hardlinks = 1
fs.protected_symlinks = 1
* Applying /etc/sysctl.d/10-magic-sysrq.conf ...
kernel.sysrq = 176
* Applying /etc/sysctl.d/10-network-security.conf ...
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.tcp_syncookies = 1
* Applying /etc/sysctl.d/10-ptrace.conf ...
kernel.yama.ptrace_scope = 1
* Applying /etc/sysctl.d/10-zeropage.conf ...
vm.mmap_min_addr = 65536
* Applying /usr/lib/sysctl.d/50-default.conf ...
net.ipv4.conf.all.promote_secondaries = 1
net.core.default_qdisc = fq_codel
* Applying /etc/sysctl.d/90-omnibus-gitlab-kernel.sem.conf ...
* Applying /etc/sysctl.d/90-omnibus-gitlab-kernel.shmall.conf ...
* Applying /etc/sysctl.d/90-omnibus-gitlab-kernel.shmmax.conf ...
kernel.shmmax = 17179869184
* Applying /etc/sysctl.d/90-omnibus-gitlab-net.core.somaxconn.conf ...
* Applying /etc/sysctl.d/99-sysctl.conf ...
* Applying /etc/sysctl.conf ...
STDERR: sysctl: cannot open "/etc/sysctl.d/90-omnibus-gitlab-kernel.sem.conf": No such file or directory
sysctl: cannot open "/etc/sysctl.d/90-omnibus-gitlab-kernel.shmall.conf": No such file or directory
sysctl: cannot open "/etc/sysctl.d/90-omnibus-gitlab-net.core.somaxconn.conf": No such file or directory
---- End output of sysctl -e --system ----
Ran sysctl -e --system returned 255
Running handlers complete
Chef Client failed. 167 resources updated in 53 seconds
dpkg: error processing package gitlab-ee (--configure):
installed gitlab-ee package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
gitlab-ee
E: Sub-process /usr/bin/dpkg returned an error code (1)

The "Error executing actioncreateon resource 'gitlab_sysctl[kernel.shmmax" mostly points out to /sys being read-only.
See for instance omnibus-gitlab issue 1308
Set these values in /etc/sysctl.conf on the host, and run cat /etc/sysctl.conf /etc/sysctl.d/*.conf | sysctl -e -p - on the host.
Then run reconfigure in your lxc container again, it should detect that the kernel is already running with the necessary settings, and not make any changes.
Note: the values can be found here:
root#gitlab:~# cat /opt/gitlab/embedded/etc/90-omnibus-gitlab-*
kernel.sem = 250 32000 32 262
kernel.shmall = 4194304
kernel.shmmax = 17179869184
net.core.somaxconn = 1024
I recently tried out setting up the dev environment in a vagrant/lxc container (debian/jessie64 box) and I had to remount proc filesystem in rw mode (using mount -o remount rw /proc/sys) for setting the values.

I have found a temporary solution. (way it's work ??? xD )
I edit the file
sudo nano /opt/gitlab/embedded/cookbooks/package/resources/gitlab_sysctl.rb
section
Load the settings
to:
# Load the settings right away
#execute "load sysctl conf #{new_resource.name}" do
# command "sysctl -e --system"
# action :nothing
#end
execute "sysctl" do
command "/sbin/sysctl -e -p /etc/sysctl.conf"
action :nothing
end
enter code here
end
sudo gitlab-ctl reconfigure

Related

ESXi | Persistent Cron job | /etc/rc.local.d/local.sh writing directory to cron file

I am trying to create a persistent cron job (i.e. one that survives reboot). I have followed this guide:
https://virtuallyvtrue.com/2019/03/29/shell-script-to-automatically-power-on-a-specific-vm-which-is-powered-off-vm/
I created a shell file in this directory.
/vmfs/volumes/datastore1/power-off.sh
I've updated the root cron file:
/var/spool/cron/crontabs/root
#min hour day mon dow command
1 1 * * * /sbin/tmpwatch.py
1 * * * * /sbin/auto-backup.sh ++group=host/vim/vmvisor/backup.sh
0 * * * * /usr/lib/vmware/vmksummary/log-heartbeat.py
*/5 * * * * /bin/hostd-probe.sh ++group=host/vim/vmvisor/hostd-probe/stats/sh
00 1 * * * localcli storage core device purge
*/10 * * * * /bin/crx-cli gc
00 0 * * * /vmfs/volumes/datastore1/power-off.sh
I edited the local.sh file to write the cron job and make it persistent.
/etc/rc.local.d/local.sh
Contents of local.sh
/bin/kill $(cat /var/run/crond.pid)
/bin/echo ‘00 0 * * * /vmfs/volumes/datastore1/power-off.sh’ >> /var/spool/cron/crontabs/root
crond
When the system reboots, a new cron job entry is created, but it appears to be using the time/date '*' as wildcards and is dumping the directory structure into the cron file:
#min hour day mon dow command
1 1 * * * /sbin/tmpwatch.py
1 * * * * /sbin/auto-backup.sh ++group=host/vim/vmvisor/backup.sh
0 * * * * /usr/lib/vmware/vmksummary/log-heartbeat.py
*/5 * * * * /bin/hostd-probe.sh ++group=host/vim/vmvisor/hostd-probe/stats/sh
00 1 * * * localcli storage core device purge
*/10 * * * * /bin/crx-cli gc
'00 0 altbootbank bin bootbank bootpart.gz bootpart4kn.gz dev etc include lib lib64 local.tgz local.tgz.ve locker opt proc productLocker sbin scratch store tardisks tardisks.noauto tmp usr var vmfs vmimages altbootbank bin bootbank bootpart.gz bootpart4kn.gz dev etc include lib lib64 local.tgz local.tgz.ve locker opt proc productLocker sbin scratch store tardisks tardisks.noauto tmp usr var vmfs vmimages altbootbank bin bootbank bootpart.gz bootpart4kn.gz dev etc include lib lib64 local.tgz local.tgz.ve locker opt proc productLocker sbin scratch store tardisks tardisks.noauto tmp usr var vmfs vmimages altbootbank bin bootbank bootpart.gz bootpart4kn.gz dev etc include lib lib64 local.tgz local.tgz.ve locker opt proc productLocker sbin scratch store tardisks tardisks.noauto tmp usr var vmfs vmimages /vmfs/volumes/datastore1/power-off.sh’
Are the startquote and endquote symbols required in the local.sh file? I can see that they're being inserted into the /var/spool/cron/crontabs/root file.
I'd really appreciate some help with this. I just need to power off my server at midnight and I can't believe it is this difficult.
The guide used incorrect syntax. It required " instead of ' in the /etc/rc.local.d/local.sh echo statement.
/bin/kill $(cat /var/run/crond.pid)
/bin/echo "00 0 * * * /vmfs/volumes/datastore1/power-off.sh" >> /var/spool/cron/crontabs/root
crond

gitlab-ctl reconfigure error by /var/opt/gitlab/postgresql/data -E UTF8

I tried these but it didn't work。
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
Error log
================================================================================
Error executing action `run` on resource 'execute[/opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8]'
================================================================================
There was an error running gitlab-ctl reconfigure:
execute[/opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8] (postgresql::enable line 54) had an error: Errno::EACCES: Permission denied - /opt/gitlab/embedded/bin/initdb
Full log
Recipe: postgresql::user
* account[Postgresql user and group] action create
* group[Postgresql user and group] action create (up to date)
* linux_user[Postgresql user and group] action create (up to date)
(up to date)
* directory[/var/opt/gitlab/postgresql] action create (up to date)
* file[/var/opt/gitlab/postgresql/.profile] action create (up to date)
Recipe: postgresql::sysctl
* gitlab_sysctl[kernel.shmmax] action create
* directory[create /etc/sysctl.d for kernel.shmmax] action create (up to date)
* file[create /opt/gitlab/embedded/etc/90-omnibus-gitlab-kernel.shmmax.conf kernel.shmmax] action create (up to date)
* link[/etc/sysctl.d/90-omnibus-gitlab-kernel.shmmax.conf] action create (up to date)
* execute[load sysctl conf kernel.shmmax] action nothing (skipped due to action :nothing)
(up to date)
* gitlab_sysctl[kernel.shmall] action create
* directory[create /etc/sysctl.d for kernel.shmall] action create (up to date)
* file[create /opt/gitlab/embedded/etc/90-omnibus-gitlab-kernel.shmall.conf kernel.shmall] action create (up to date)
* link[/etc/sysctl.d/90-omnibus-gitlab-kernel.shmall.conf] action create (up to date)
* execute[load sysctl conf kernel.shmall] action nothing (skipped due to action :nothing)
(up to date)
* gitlab_sysctl[kernel.sem] action create
* directory[create /etc/sysctl.d for kernel.sem] action create (up to date)
* file[create /opt/gitlab/embedded/etc/90-omnibus-gitlab-kernel.sem.conf kernel.sem] action create (up to date)
* link[/etc/sysctl.d/90-omnibus-gitlab-kernel.sem.conf] action create (up to date)
* execute[load sysctl conf kernel.sem] action nothing (skipped due to action :nothing)
(up to date)
Recipe: postgresql::enable
* directory[/var/opt/gitlab/postgresql] action create (up to date)
* directory[/var/opt/gitlab/postgresql/data] action create (up to date)
* directory[/var/log/gitlab/postgresql] action create (up to date)
* directory[/var/opt/gitlab/postgresql/data] action create (up to date)
* link[/var/opt/gitlab/postgresql/data] action create (skipped due to not_if)
* execute[/opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8] action run
================================================================================
Error executing action `run` on resource 'execute[/opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8]'
================================================================================
Errno::EACCES
-------------
Permission denied - /opt/gitlab/embedded/bin/initdb
Resource Declaration:
---------------------
# In /opt/gitlab/embedded/cookbooks/cache/cookbooks/postgresql/recipes/enable.rb
54: execute "/opt/gitlab/embedded/bin/initdb -D #{node['postgresql']['data_dir']} -E UTF8" do
55: user postgresql_username
56: not_if { pg_helper.bootstrapped? || pg_helper.delegated? }
57: end
58:
Compiled Resource:
------------------
# Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/postgresql/recipes/enable.rb:54:in `from_file'
execute("/opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8") do
action [:run]
default_guard_interpreter :execute
command "/opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8"
backup 5
declared_type :execute
cookbook_name "postgresql"
recipe_name "enable"
domain nil
user "gitlab-psql"
not_if { #code block }
end
System Info:
------------
chef_version=15.14.0
platform=ubuntu
platform_version=22.04
ruby=ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
program_name=/opt/gitlab/embedded/bin/chef-client
executable=/opt/gitlab/embedded/bin/chef-client
Running handlers:
There was an error running gitlab-ctl reconfigure:
execute[/opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8] (postgresql::enable line 54) had an error: Errno::EACCES: Permission denied - /opt/gitlab/embedded/bin/initdb
Notes:
It seems you haven't specified an initial root password while configuring the GitLab instance.
On your first visit to your GitLab instance, you will be presented with a screen to set a
password for the default admin account with username `root`.
Running handlers complete
Chef Infra Client failed. 47 resources updated in 10 minutes 41 seconds
Notes:
It seems you haven't specified an initial root password while configuring the GitLab instance.
On your first visit to your GitLab instance, you will be presented with a screen to set a
password for the default admin account with username `root`.

change letsencrypt certbot run time

I have setup certbot for letsencrypt key renewal. This works.
When i check my logs at /etc/log/letsencrypt i see it runs twice a day.
Somewhere around midnight and somewhere around noon.
I would like to run it only once a day somewhere in the early morning.
To get control over the running of certbot i removed all entries from my cronjobs. But unexpectedly it still runs.
So how is certbot started?
Extra info:
when i run a script to show all cronjobs i get this:
(script: How do I list all cron jobs for all users? )
mi h d m w user command
0 3 * * 1 root /usr/bin/rsnapshot weekly
0 */4 * * * root /usr/bin/rsnapshot hourly
16 10 * * * root test -x /etc/cron.daily/popularity-contest && /etc/cron.daily/popularity-contest --crond
25 6 * * * root /etc/cron.daily/apache2
25 6 * * * root /etc/cron.daily/apt-compat
25 6 * * * root /etc/cron.daily/aptitude
25 6 * * * root /etc/cron.daily/automysqlbackup
25 6 * * * root /etc/cron.daily/bsdmainutils
25 6 * * * root /etc/cron.daily/dpkg
25 6 * * * root /etc/cron.daily/exim4-base
25 6 * * * root /etc/cron.daily/logrotate
25 6 * * * root /etc/cron.daily/man-db
25 6 * * * root /etc/cron.daily/mlocate
25 6 * * * root /etc/cron.daily/ntp
25 6 * * * root /etc/cron.daily/passwd
25 6 * * * root /etc/cron.daily/popularity-contest
25 6 * * * root /etc/cron.daily/tomcat8
30 2 1 * * root /usr/bin/rsnapshot monthly
30 3 * * * root /usr/bin/rsnapshot daily
47 6 * * 7 root /etc/cron.weekly/man-db
the file from certbot i found was certbot in /etc/cron.d
it contained this line:
#0 4 * * * root test -x /usr/bin/certbot -a \! -d /run/systemd/system && perl -e 'sleep int(rand(3600))' && certbot -q renew
which i commented out (with the #).
my system is debian:
Debian GNU/Linux 9
I use certbot with Ubuntu 16.04 + nginx
There are two places to check jobs related to Certbot
1) /etc/cron.d/certbot
here you have
0 */12 * * * root test -x /usr/bin/certbot -a \! -d /run/systemd/system && perl -e 'sleep int(rand(3600))' && certbot -q renew && nginx -s reload
2) systemd timer
run commnad:
$sudo systemctl list-timers
and see output
Sun 2018-07-08 00:46:59 EEST 7h left Sat 2018-07-07 12:36:26 EEST 4h 51min ago certbot.timer certbot.service
then
3)
go to check file that control time when systemctl run Certbot
/etc/systemd/system/timers.target.wants/certbot.timer
that is symbolic link for
/lib/systemd/system/certbot.timer
Pay attention to this lines that define times + random seconds (set a random time for purpose to don't stress simultaneously letsencrypt servers)
OnCalendar=--* 00,12:00:00
RandomizedDelaySec=3600

run multiple task in crontab in the same time without delay

I have to run task which take time 3 or 5 minut
How to run multiple task in crontab -in same time ?
crontab -e
0 13 * * * /etc/rip_first_radio.sh
0 13 * * * /etc/rip_second_radio.sh
0 13 * * * /etc/rip_third_radio.sh
0 13 * * * /etc/rip_fourth_radio.sh
your crontab config is correct. But you can add add all into one script and run also.
vi main.sh
./etc/rip_first_radio.sh &
./etc/rip_second_radio.sh &
./etc/rip_third_radio.sh &
./etc/rip_fourth_radio.sh &
and add main.sh to cron.
0 13 * * * ./main.sh

Setting a cron job for python script

I want to run the following command for cron job
python test.py -sau 0 -bg 200000 -t mcs3245 > g2g.log
I have setup a cron job like below
5 0 * * * /local/mnt/workspace/username/scripts/python test.py -sau 0 -bg 200000 -t mcs3245 > g2g.log
am getting the following error
/bin/sh: /local/mnt/workspace/username/scripts/python: No such file or directory
Can anyonehelp on what is wrong and how to set this up?
Unless /local/mnt/workspace/username/scripts/ is the directory of your python installation I would suggest something like this:
5 0 * * * /usr/bin/python /path/to/script/test.py -sau 0 -bg 200000 -t mcs3245 > g2g.log
If you want to execute the script as user USERNAME:
5 0 * * * USERNAME /usr/bin/python /path/to/script/test.py -sau 0 -bg 200000 -t mcs3245 > g2g.log
Found that last one here on superuser.com.

Resources