OSTicket Cron

Discussion in 'General' started by dinakar, Oct 16, 2017.

  1. dinakar

    dinakar New Member

    Hello

    iam trying to setup a cron for OSTicket - PHP website application hosted withing ISPConfig 3.1 Dev with no success for quite sometime now..

    the cron entry for the website looks like this

    root@whm01:/etc/cron.d# ll
    total 48
    drwxr-xr-x 2 root root 4096 Oct 16 06:26 ./
    drwxr-xr-x 120 root root 12288 Oct 16 06:26 ../
    -rw-r--r-- 1 root root 281 Feb 18 2016 amavisd-new
    -rw-r--r-- 1 root root 260 Sep 4 2016 awstats
    -rw-r--r-- 1 root root 238 Oct 16 06:26 ispc_chrooted_web36
    -rw-r--r-- 1 root root 1566 May 14 2015 mailman
    -rw-r--r-- 1 root root 589 Jul 16 2014 mdadm
    -rw-r--r-- 1 root root 670 Mar 1 2016 php
    -rw-r--r-- 1 root root 102 Apr 5 2016 .placeholder
    -rw-r--r-- 1 root root 190 Sep 4 2016 popularity-contest
    root@whm01:/etc/cron.d# vi ispc_chrooted_web36
    MAILTO=''
    SHELL='/usr/sbin/jk_chrootsh'

    */2 * * * * web36 /usr/bin/wget -q -O /dev/null --user-agent=3477BC78CD8E5F4707B7F7897A163E9 http://servicedesk.domain.me/api/cron.php >>/private/cron.log 2>>/private/cron_error.log #servicedesk.domain.me


    no errors logged in website /private folder and syslog
    'System - Server config -> Jailkit -> Jailkit cron chrooted applications' has /usr/bin/wget entry as well..
    ispc_chrooted_web36 is owned by root - could this be a problem? but, it was automatically created by ispconfig.

    thanks for any quick help in this ...
     
  2. HSorgYves

    HSorgYves Active Member HowtoForge Supporter

    Can you resolve the domain name in the chroot?
     
  3. dinakar

    dinakar New Member

    Yes. It resolves the domain name and ping also works.
     
  4. dinakar

    dinakar New Member

    In some other post, ive seen creating a shell user for the website made it work. But, now after i created a shell user, putty closes out immediately after successful login for the ispconfig user.

    does anyone know how to resolve this. thx
     
  5. dinakar

    dinakar New Member

    Till - your help is required...

    After i created a Shell user for a website, the root user is not able to properly login. When logged in through both putty and terminal, it automatically logs out after the welcome message.

    do you have a solution
     
  6. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Check the logs and see if anything stands out. Can you login as the non-root use?
     
  7. dinakar

    dinakar New Member

    I created a shell user from ISPConfig control panel and that is able to access/login to the server through putty without any issues. Only when logging in with root account, it logs out immediately. When trying to login with WinSCP, it throws an error 'unexpectedly closed. Server sent command exit status 0'. Please see screeenshot attached.
     

    Attached Files:

  8. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Screenshot shows login with user ispconfig. But you wrote the problem is with user root?
     
  9. dinakar

    dinakar New Member

    root account is locked by default. ispconfig is the account which has access to sudo to root.
    is there a way we can allow sudo to root permission to shell users created in ispconfig control panel? or is there a some way the root password in ubuntu can be reset. Please note i do not have any ways to login to the m/c root is locked and ispconfig is logging off automattically after login. Or is there an option in putty to enter a command immdediately after login like reset root password before it logs out. thx
     
  10. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    well, read the error message. it states there are some greetings which are not supported by your current configuration. something like in .bashrc, /etc/profile.d/*.sh or somewhere ... which shell is set for user ispconfig? try to connect from a linux shell, from another server, live disc dunno. some kind of remote console for the server?

    could be bad file/folder permissions ... hmm maybe boot some sort of rescue mode / live disc and fix by mount
     
  11. dinakar

    dinakar New Member

    is there a possibility of installing second server and move all the domain/email/other contents to new server and scrap the old server?
     
  12. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Sorry for writing so shortly previously, I was on my tablet computer and writing on that is difficult. Now on a real keyboard.
    The user ispconfig is created by ISPConfig installation, you should not use it for logging in, and best is not to use it at all and leave it to ISPConfig. The problem you have with logging in is probably because ispconfig is prevented from logging in and has no shell.
    Since you are on Ubuntu, create a user for yourself, name it whatever and add that whatever user to group sudo, then it can sudo to get root permissions. Read more from Ubuntu Wiki: https://help.ubuntu.com/community/RootSudo
    The user created during Ubuntu installation already has sudo permissions, you can use that. If you really want to log in with root I think it is possible by mucking about in Ubuntu settings, but Ubuntu is supposed to be used with sudoing users, and I find it preferable to use stuff the way it is supposed to be used, causes less hassle. Or use Debian GNU/Linux, there root is a real user that can log in (but default is to prevent login with password, you have to use ssh key).
     
  13. dinakar

    dinakar New Member

    No problem. The ubuntu admin created during installation is 'ispconfig'. Somehow it worked and its still working in a cloned VM running in another location. Please find screenshot attached. The problem occurred only when/after meddling with cron entries. Anyways, its urgent for me to fix the problem and restore service since server is out of space and MySQL going down every few hours. Do you think its a good idea to install a new server and move the domain/email and other contents to the new server?. I saw in another post that we can install the second slave server using the expert mode during ISPConfig installation. Once installed, move all the contents from master server, change DNS pointings and scrap the master server - will this plan work. thx
     

    Attached Files:

  14. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Ubuntu installer asks what username to create during installation. Do not write ispconfig there. Or any other name that is already used or is going to be used for something else.
    Is there really something wrong with the current server? Find a way to get in as root, and fix the user accounts. Stop using ispconfig -user, and create a new user with sudo permissions for you.
    It would be easier to see what is going on If you had opened a new thread when a completely different issue appeared.
    If you can not get root on the server, it is going to be hard to move the websites and e-mails to another server. And if you can get root, it seems you can continue using the server.
    If, however, you decice to move the websites and e-mails, it is possible. There is Migration Toolkit just for that in ISPConfig Add-Ons. If you do not want to use that, you can move the websites and databases the usual manual way. Copying e-mails means creating account on the TARGET host and copying the mail-directory. There are howtos and discussions on this forum about that.
     
  15. dinakar

    dinakar New Member

    thank you for the detailed reply. Since, you have not mentioned about having a slave server, i believe, its not an option. Please confirm. I will try other options keep it updated here. Since, the server is in production, may take some days to update. thx
     
  16. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    If the master server is messed up, adding another server to the ISPConfig multiserver setup may not work. And you would still have a messed up master server.
    If the master server works OK and you can sudo to root, you can add more servers to the setup. But moving websites to the other server is still manual labor, ISPConfig can not move stuff from server to server. So I would say adding a slave server does not help. You could as well install a new standalone master server and make sure you set it up correctly now that you have gained experience.
     
  17. dinakar

    dinakar New Member

    thanks. Iam planning for a fresh install and move required services to the new server. Email and Pydio are the biggest in moving and planning is required. Do you have any reference links that will help. thx
     

Share This Page