Is ti possible to change the default user for the build process to a custom user? - gitlab-ci-runner

gitlab-ci-multi-runner uses gitlab-runner as the user when using the shell executor. Is ti possible to change the default user for the build process to a custom user?

Related

Not Able to set resource type in logs using command 'gcloud logging logs write' . Entries getting created under global resource type

I am using Ubuntu 18.04 on Google compute engine.
I am using the steps as shown in Google cloud documentation. My command is
sudo gcloud logging write "logname" "A simple entry"
The entry gets created but under the resource type as 'global'. However i want it to be created under resource name as compute engine.
I have tried setting logname as "projects/campuskudos-980/logs/appengine.googleapis.com%2Fvm.syslog" but that didn't work out
sudo gcloud logging write "logname" "A simple entry"
I want the logs to be created under GCE VM Instance resource type. So I can filter it out on stackdriver
Currently there’s no way to specify the resource type when using gcloud logging write command. As explained in the documentation for simplicity, this command makes several assumptions about the log entry. For instance, it always sets the resource type to global.
Right now, there are two ways to do that:
1- With the gcloud logging write command, use logname and specify something like projects/[PROJECT_ID]/logs/compute.googleapis.com. After that, using advanced filters on Stackdriver Logging as explained in the documentation, you can filter logs using an advanced filter to query all entries inside ‘compute.googleapis.com’.
For e.g.:
logName: (“projects/[PROJECT_ID]/logs/compute.googleapis.com”)
2- Call directly to API as explained in documentation specifying resource type as gce_instance.
Then that entry will appear under GCE VM Instance resource type on Stackdriver Logging.

OpenShift oc user is logged out after a while

I am using a cloudformation script,
where I successfully execute oc login -u user -p password
My script goes on and after a while I face problems,
because I seem not to be logged in anymore.
$(oc whoami) gives an empty space.
What could be the reason, that the login is lost after a while?
When you authenticate to the OpenShift API as a user you are assigned an oauth token which will expire after some time. This value is set in the master-config.yaml file. Default location /etc/origin/master/master-config.yaml. This value is set under oauthConfig.tokenConfig.accessTokenMaxAgeSeconds, default value is 86400 or 24 hours
Also take a look at oauthConfig.sessionMaxAgeSeconds which could be the issue you are hitting given the time you mentioned in your comment.
If you need to get a token that won't expire you could look at creating a service account. This may be the preferred option if you intend to automate this.

how to execute script on zabbix agent?

I have made a magic script on Zabbix agent and i wanna to execute on Zabbix agent using Zabbix item.i will be thankful to you in advance for this . do something if you can.
You would create a user parameter that would look like any other item from the server side. On the agent side, you would have to edit the agent configuration file and restart the agent.
In addition to user parameters, Zabbix supports remote commands. These are appropriate (and indeed invoked from) actions as a result of some condition. So in the answer from Richv you would use that for polling for data, e.g. to find out if a process is running. Continuing that example, if the process is not running and you wanted to start it, you can ask the agent to execute a command that might start the process. To do that you must enable remote commands in the agent config file, and configure it as an action (that in turn is linked to whatever condition you had concerns about).
1st in the zabbix_agentd.conf for the remote host, add EnableRemoteCommands=1
Then see the video at https://youtu.be/G6jfahBZwlk
In the video, a bat file is created on the remote host, and then an item is created for the remote host using the Zabbix server interface, and selecting the system.run option in the key options.

Advanced Installer- How to create MySQL user during installer?

Im ready to deploy my project and I'm using Advanced Installer to package it. My project does involved a Database connection. My goal is during installation I will have a dialog that will ask user to setup a username and password for MYSQL database connection (and perhaps other mysql server fields).
How can I achieve this using Advanced Installer?
Any suggestion is welcome.
Here is their user guide tutorial about how to run sql scripts during installation. Hope this is useful.
To Enter the your database credentials first you need design the dialog.to design the dialog you go under dialog option and create a new dialog by right clicking the any other dialog you need to click on the option called add dialog in add dialog you will get a popup box by asking which type of dialog where you need to select sql connection dialog click on that and you will get what you want on start up...
Go to "Custom Actions" page and create a new "Launch EXE with working directory" custom action with sequence under the "Install Execution Stage -> Searches" action group like this:
File Path: mysqld
Command: --install
Working: Path to mysql\bin\
Add a new "Launch file" custom action with sequence, scheduled after the above one, like this:
File To Launch: cmd.exe
Command Line: /c NET START mysql
Working Directory:
Run as Adminsitrator: checked
For configuring the MySQL Server you can use a BAT file as a custom action after MySQL server is installed.

Unable to create indexes in Sphinx after an emergency server restart [Can't create TCP/IP socket]

I'm trying to execute the command in the Windows console:
C:\SphinxSearch\bin\indexer --all --config C:\SphinxSearch\sphinx.conf
But I get an error:
ERROR: index 'indexname': sql_connect: Can't create TCP/IP socket
(10093) (DSN=mysql://root:*#localhost:3306/test).
A data source is mysql. Before the server restart everyone works fine.
How can I fix it?
I'm having the same error 10093. It's a windows error code by the way. In my case it occurs when trying to run the indexer through the system account via a scheduled task. If I'm running it directly as administrator, there's not a problem.
According to the site above:
Either your application hasn't called WSAStartup(), or WSAStartup() failed, or--possibly--you are accessing a socket which the current active task does not own (i.e. you're trying to share a socket between tasks).
In my case I'm thinking it might be the last one, some security problem due to user SYSTEM being used in my scheduled task. I was able to solve it by using my admin user instead: in the scheduled task, I set to use my local admin account with the option to "Run when user is logged on or not" and "Do not store password". I've also checked "Run with highest privileges". This seems to have done the trick as now my indexes are rotating on schedule.