Locked out of Jenkins - security

I enabled jenkins security thinking it would prompt me to create an account. I tried deleting and editing my config.xml file in c:/program files/jenkins but i'm not sure how to restart jenkins without having access.
Any help would be appreciated.
I'm running Jenkins on a windows server, recently updated to the latest version.

If you don't have a lot of other configuration that you'd like to save, you can just delete %JENKINS_HOME%/config.xml and restart Jenkins to disable security.
Otherwise, edit config.xml and set the values inside the <useSecurity> tags to false, then restart Jenkins.

I had this exact issue today on my windows jenkins server.
Just removing the xml file and restarting did not work for me either. I had to:
Stop the service.
Check taskmanager to ensure the process is gone.
Either edit the Config.XML file and change the useSecurity false or delete the config.xml file.
Now start the service again

You can try: How to restart Jenkins manually?
or kill the process in taskmanager or do a taskkill in windows shell.
Here are the instructions to restart from command line:
Open Command Prompt.
Type one of the following: without qoutes
To stop a service, type:
net stop 'service'
To start a service, type:
net start 'service'
Also I think you may be looking in the wrong folder. Do you have a config.xml in
C:\Users\yourUserName\.jenkins?

Related

How to add user input when starting a service in systemd

I have a service configured in systemd that runs a binary file and it runs constantly. The problem is that after running this binary file, you have to confirm Terms&Conditions by typing y in the terminal and validating it by click Enter. I cannot run this file through this, because the systemctl status appears to me as failed, because of lack of validation. Does anyone know how I can run this service and automatically accept Terms in terminal?
I figured it out in such a way:
I created .sh file in usr/bin with this content:
#!/usr/bin/bash
yes | /home/marek/webcash/webminer
Then I created config file in systemd with ExecStart: /path/to/file.sh
and now it works - systemd is running correctly, the logs are logging, the answer "yes" was typed only once in binary file when the user prompt appeared.

How to make Named work at boot to resolve DNS queries (possible crontab entry)

Hi I'm a student at Seneca in the OPS335 right now and I'm new here, so basically I setup a new DNS server on my Centos7 machine and got it working perfectly, all the zones in named.conf are setup right, all the records and files are in place, the ifcfg-ens33 and resolv.conf files are all set with the right 'IPs', 'DNS1' and 'namserver', 'search' parameters. The service is enabled to start at boot, but when i get to my terminal and try pinging google.ca or a host command it will not resolve until i manually restart the services even though they are active. Iptables are set to allow it in and out via its port (53). If anyone knows how to fix this please help me out, otherwise i had another idea with crontab.
Any help would be greatly appreciated.
So in order for me to make what i have work is to manually restart the iptables libvirtd and named services in that order, so i made a small script to do this and then tried adding it to crontab after testing it in terminal. I made it to restart the service at reboot and it works in the terminal, but when i try adding it to crontab with a new line at the end as :
#reboot /namedrestart2.bash
it does not work, named boots and is active and enabled, but it still will not resolve DNS queries.
I am not sure if i have the right PATH and SHELL set for crontab mine is :
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
SHELL=/bin/sh
MAILTO=root
The main result that i want is for named to boot properly so i dont have to go through this restart service hassle.
Again any help would be greatly appreciated.

Jenkins ignores proxy settings while building a job

I set a proxy under Plugins in Jenkins like suggested online.
I also edited the /etc/environment
bash-3.2$ cat /etc/environment
http_proxy=proxy.company.net:8080
https_proxy=proxy.company.net:8080
HTTP_PROXY=proxy.company.net:8080
HTTPS_PROXY=proxy.company.net:8080
HTTPS_PROXY_REQUEST_FULLURI=false
HTTP_PROXY_REQUEST_FULLURI=false
I verfied the variables and they are available on logon.
When I start ant manualy as root via ssh, my "composer.phar" script is able to connect and download files. As soon as Jenkins starts the job (I think its the "jenkins" linux user), he waits until timeout and aborts the build. I used "su jenkins -s /bin/bash" to get a shell as "jenkins" and the env-vars are set correctly...
What can I do? Why does Jenkins ignore these ENV-Vars?
Thanks.
The http_proxy variables (as seen e.g. on the wget man page) require a "http://" prefix to work properly for many programs.
Jenkins on the other hand has a proxy configuration at Manage Jenkins > Plugin Manager > Advanced. This configuration overrides the environment variables.
Check Alex' answer to another question for getting around this behavior for individual nodes/builds.
I did not get it solved. After a restart the server fails all Jenkins Jobs for some minutes... suddenly the connection to the proxy succeeds and everything works well.

Where is the log file using Production profile with NServiceBus GenericHost and default log4net settings when installed as a service?

I have a very simple NServiceBus.Host.exe application that is using the default logging and the Production profile. According to the documentation, this should result in an appending file log that should appear in the same folder as the EXE. However, when I run the application as a service, the log file doesn't appear in the same folder as the EXE, and thus far I've been unable to locate it at all. The service is running as Local System. Do I need to run it as a user account and look for the file in the AppData folder somewhere? Is it under c:\windows somewhere? Where is it and is there a way for me to have it actually log to a file in the same folder as the EXE as advertised?
Update:
Using ProcMon and ProcExp from SysInternals, I can see that there is no attempt to create any log file in the folder where my EXE exists, nor are there any file permission errors while trying to create a log file anywhere, at least not from the PID of the service (if for some reason log4net spins up another process to do this work then I might have missed it).
It turns out that the service wasn't actually running in the Production profile. I had for some reason gotten it into my head that services would run in the production profile by default, while running it in interactive mode would use Lite by default. Not so - the service will use the Lite profile unless you specify otherwise. I changed my command to install the service from:
NServiceBus.Host.exe /install /displayName:MyService
to
NServiceBus.Host.exe /install /displayName:MyService NServiceBus.Production
and this fixed the issue.

Ubuntu-Apache: How to start automatically apache at boot?

I have zend server. So I tried to make an option in System->Preferences->Sessions
Added /usr/local/zend/bin/zendctl.sh.
Also tried /usr/local/zend/bin/zendctl.sh start-apache and /usr/local/zend/bin/sh zendctl.sh start-apache.
Nothing started.
The same is for MySQL - doesn't started also.
Any ideas how to make autorun for these?
remove your start up application entry which you stated above.
Below solution would be fine if you can start your zend server with:
sudo /usr/local/zend/bin/zendctl.sh start-apache
if your server can be started by the command, then process
open /etc/init.d/rc.local using your favorite text editor (with super-user privilege)
e.g.
sudo nano /etc/init.d/rc.local
append your start up command at the end of the file,then save & exit & reboot
/usr/local/zend/bin/zendctl.sh start-apache

Resources